The Insightful Troll

Rants and ruminations.

Using Mermaid With Octopress/Jekyll

| Comments

Markdown is a pretty nice tool for developers to write documents. But it doesn’t support creating graphs & charts easily. Mermaid is a powerful js library which can convert a text described graph or chart and render it. It’s a perfect tool when using with Octopress (A bloging tool based on Jekyll). Here I’ll show you how to integrate the mermaid with minimal effort into your Octopress (or Jekyll) website.

For the purposes of this tutorial - I will be be using Octopress, but this should be fairly trivial to also add this to your Jekyll template.

Integrating mermaid.js directly

While there is a Jekyll Mermaid plugin available, it is much more complicated to setup and use. We will be using the mermaid CDN directly. Lets get started.

In your Octopress blog directory, navigate to the source/_includes/head.html file and add the following anywhere between the tags. If you are using Jekyll, just add it to where ever your header tags are defined (usually in _layouts/default.html).

1
2
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script>mermaid.initialize({startOnLoad:true});</script>

Since Markdown is pretty friendly to html tags, you can simply add a diagram by wrapping mermaid markup in a div with class “mermaid” for example:

1
2
3
4
5
6
7
<div class="mermaid">
graph LR
    A[Hard edge] -->|Link text| B(Round edge)
    B --> C{Decision}
    C -->|One| D[Result one]
    C -->|Two| E[Result two]
</div>

Which when rendered outputs:

graph LR A[Hard edge] -->|Link text| B(Round edge) B --> C{Decision} C -->|One| D[Result one] C -->|Two| E[Result two]


You can try out your code before deployment using a live editor. Mermaid documentation can be found here.

Thats it! If you have any questions feel free to get in touch or leave a comment.

Church Organ Music With a Commodore 64

| Comments


Linus Akesson he remapped the keys of a Commodore 64 so he could play it like an accordion, ran it though a reverb machine, and created the sixtyforgan. The Bach piece he plays at the end of the video above sounds so much like it’s being played on an organ.

Spring reverb + Commodore 64. I have said it before, the Commodore 64 was the greatest home computer ever made. I can’t tell you how many fellow developers started their programming careers on that machine. Far ahead of its time.

Album of the Week: Californication

| Comments

Welcome to a new weekly series of blog posts inspired by my upgrade to a Cambridge Audio CXN V2 Stereo Network Streamer. What is a network audio streamer you ask? That is one complicated rabbit hole to go down. Simply put, its is a device that lets you stream music from the cloud. But that is a discussion for another time.

The idea here is to present an album each week that I have throughly enjoyed. For this inaugural week it is Californication by the Red Hot Chili Peppers.

Greg Tate sums it best:

Historically, though, RHCP albums have been long on sock-it-to-me passion but short on the songcraft that made their hero George Clinton’s most acid-addled experiments lyrically haunting and melodically infectious. Up until this new Peppers joint, Californication, that is. For Lord knows what reasons — age, sobriety, Blonde on Blonde ambitions or worship at the altar of Billy Corgan — they’ve settled down and written a whole album’s worth of tunes that tickle the ear, romance the booty, swell the heart, moisten the tear ducts and dilate the third eye. All this inside of song forms and production that reveal sublime new facets upon each hearing.

Anthony Kiedis has found the blues. John Frusciante’s work on the guitar is right up there with Hendrix. Flea’s leads and bass lines on solidifies him as one of, if not the bassist of the past three decades. With the title track Californication, RHCP has blown past their funk-rap past outing to something that is truly a classic.

It's the edge of the world and all of Western civilization
The sun may rise in the East at least it's settled in a final location
It's understood that Hollywood sells Californication

And we are all buying it.

Whatever It Takes to Get Things Done

| Comments

David A. Graham in The Atlantic:

That writer was me, and the quick passage of now-President Biden’s $1.9 trillion coronavirus-relief package is, among other things, a rebuke of my analysis. Biden’s success suggests that I misunderstood how his many years in the Senate have shaped his approach to politics.

David A. Graham: Biden is in denial about the Republican Party

I thought that Biden’s frequent paeans to the Senate of yore meant that he would prioritize cutting deals across the aisle above all. During his presidential campaign, Biden was happy to encourage this impression. But there’s another, contradictory lesson of the old Senate, and it’s the one that Biden has followed thus far as president: You do whatever it takes to get things done.

Meghan Markle Didn't Do the Work

| Comments

Caitlin Flanagan in The Atlantic:

With the calumny of the flower-girl dresses cleared up, it was time to roll a piece of previously recorded tape, featuring Meghan, Harry, and Oprah squeezed into the young couple’s chicken coop, which is populated with “rescue chickens.” (Meghan: “I just love rescuing.”) What was the best thing about their new life? Oprah asked from inside the coop. The chance “to live authentically,” Meghan said, as though she and Harry were mucking out stables in Hertfordshire, not tending to rescue chickens on a $15 million estate. “It’s so basic,” she continued, “but it’s really fulfilling. Just getting back down to basics.

[...]

Part of Meghan’s problem, it turned out, was her naïveté about the workings of the Royal Family, which she had assumed would be similar to the workings of celebrity culture. What was she, Meghan Markle, a simple girl from Los Angeles, to have understood about such an institution as the British? How was she to know that Elizabeth II, by the Grace of God, of the United Kingdom of Great Britain and Northern Ireland and of her other realms and territories Queen, Head of the Commonwealth, Defender of the Faith was in any way different from the Lady of Gaga? One wonders whether her study of foreign service and international relations, her internship at the American embassy in Argentina, and her work with the UN might have clued her in to the fact that a whole world exists beyond the Jamba Juice on La Brea and the set of Deal or No Deal, on which she had once been one of the beautiful “suitcase girls.” Apparently, they had not.

She told Oprah that she had never even Googled her future husband’s name—a remark that united the viewing world in hilarity, time zone by time zone. It was an assertion that strained credulity, but it was necessary to her contention that she’d had no idea that the Windsors had not, as we now say, “done the work” when it came to exploring their own racial biases. Had she herself done some work by punching her beloved’s name into a search engine, she would have understood that she was not marrying the most racially conscious person on the planet. She would have seen pictures of him dressed as a Nazi at a costume party (his great-granduncle—briefly Edward VIII—had palled around with Adolf Hitler) and a videotape of him introducing a fellow cadet as “our little Paki friend.” The Palace said that “Prince Harry used the term without any malice and as a nickname about a highly popular member of his platoon.” But the palace had no good explanation for why Harry introduced another cadet in the video by saying, “It’s Dan the Man. Fuck me, you look like a raghead.”

[..]

And Harry sat there beside her, 7,000 miles from home, in the land of rich Californians and Meyer lemons and eucalyptus trees trailing Spanish moss. He had plighted his troth to this unexpected and very beautiful woman; he had hurt his grandmother, and alienated his father and his only brother. He had thought that having Bishop Michael Bruce Curry deliver the homily at his wedding would reverse a thousand years of English racial attitudes, but he had been wrong about that.**He was a combat veteran, a prince, the grandson, great-grandson, and great-great-grandson of English monarchs, and now he was going to have to think up some podcasts.

The amount of entitlement and privilege on display here by these two is repulsive. I don’t feel bad for either of them - Meghan can rescue chickens the rest of her life, and Harry can spend his days in that garden thinking up the next great podcast.

I hope they do well. I really do. Just spare us the details. Please.

None of This Needed to Happen

| Comments

Now that we're hopefully on the way out of the COVID pandemic and people (myself included) are celebrating how awesome these innovative vaccines are and how great it is that we'll be able to go back to the things we've missed, I want to point out that none of this needed to happen. Many countries were able to rapidly contain COVID, including Japan, China, South Korea, Taiwan, Vietnam, Australia, and New Zealand. We're looking back on one of the biggest failures of our government ever, not just at the national level, but also at the state and local level. This means we need to study all the countries that aced the COVID test and learn how they did it.

YKK Zippers

| Comments

Want to know if something is high quality? Pay attention to the details. For example - I don’t buy anything that doesn’t have YKK zippers.

Josh Centers for the The Prepared:

A “pro tip” for evaluating the quality of a piece of gear is to look at the small details, such as zippers and stitching. Cheap-minded manufacturers will skimp on those details because most people just don’t notice, and even a cheap component will often last past a basic warranty period, so it’s an easy way to increase profits without losing sales or returns.

If a designer does bother to invest in quality components, that’s a tried-and-true sign that the overall product is better than the competition. Zippers are a classic example when looking at backpacks, clothing, and similar gear. And although there are a few other fine zipper brands out there, the king is YKK Group — to the point that the first thing some gear reviewers look for is the “YKK” branding on the zipper pull tab.

My dad used to do some work for YKK back in the ‘90s, so I wanted to dig deeper into why they’re the king and what makes their zippers so associated with quality.

[...]

YKK Zippers are amazing, because they self-lubricate the more you use them. You’ll notice that other brands of zippers become sticky and gritty over time. Not with YKK… They will feel more smooth, the more you use them.

I have products that I have been using for the past 25 years that use them. I have never had a YKK zipper fail on me.

Yo-Yo Ma Plays Impromptu Cello Concert at Covid-19 Vaccination Clinic

| Comments


When Ma had first visited the clinic for his first shot, he did so quietly, taking in the surroundings, staff said. But brought his cello when he returned for the second shot.

Staff described how a hush fell across the clinic as Ma began to play. “It was so weird how peaceful the whole building became, just having a little bit of music in the background,” said Leslie Drager, the lead clinical manager for the vaccination site, according to the Washington Post.

A Silly People

| Comments


Well we are the silly people now. You know who doesnt' care that there's a stereo type of a Chinese man in a Dr Suess book? China. All 1.4 billion of them could give a crouching tiger flying fuck. Because they are not a silly people. If anything they are as serious as a prison fight.

Look we all know China does bad stuff. They break promises about Hong Kong autonomy, they put leaders in camps and punish dissent. We don't want to be that. But there has gotta be something between authoratarian government that tells everyone what to do and a representative government that can't do anything.

Tina

| Comments


Tina an upcoming documentary Tina Turner, with interviews with Angela Bassett, Oprah, Kurt Loder, and Tina Turner herself. Airing March 27th on HBO.

Private Schools Have Become Truly Obscene

| Comments

In a just society, there wouldn’t be a need for these expensive schools, or for private wealth to subsidize something as fundamental as an education. We wouldn’t give rich kids and a tiny number of lottery winners an outstanding education while so many poor kids attend failing schools. In a just society, an education wouldn’t be a luxury item.

We have become a country with vanishingly few paths out of poverty, or even out of the working class. We’ve allowed the majority of our public schools to founder, while expensive private schools play an outsize role in determining who gets to claim a coveted spot in the winners’ circle. Many schools for the richest American kids have gates and security guards; the message is you are precious to us. Many schools for the poorest kids have metal detectors and police officers; the message is you are a threat to us.

Public-school education—the specific force that has helped generations of Americans transcend the circumstances of their birth—is profoundly, perhaps irreparably, broken.

Through a Nurse’s Eyes

| Comments


So many Americans have died in hospitals without family by their side, but they were not alone. Nurses brush patients’ teeth, change their catheters and hold their hands in their final moments.

The true heroes of this pandemic. Thank your a health care workers when you see them. Wear your mask. Write your senators and representatives to give these nurses and physicians the support they need.

Why Are COVID-19 Cases Dropping?

| Comments

Derek Thompson in The Atlantic:

One month ago, the CDC published the results of more than 20 pandemic forecasting models. Most projected that COVID-19 cases would continue to grow through February, or at least plateau. Instead, COVID-19 is in retreat in America. New daily cases have plunged, and hospitalizations are down almost 50 percent in the past month. This is not an artifact of infrequent testing, since the share of regional daily tests that are coming back positive has declined even more than the number of cases. Some pandemic statistics are foggy, but the current decline of COVID-19 is crystal clear.

What’s behind the change? Americans’ good behavior in the past month has tag-teamed with (mostly) warming weather across the Northern Hemisphere to slow the pandemic’s growth; at the same time, partial immunity and vaccines have reduced the number of viable bodies that would allow the coronavirus to thrive. But the full story is a bit more complex.

Everyone is looking for a good answer and ignoring the obvious. Sure the vaccine, seasonality, partial immunity are all a contributing factor. However, the easiest explanation tends to be the right one. We don’t need to overthink this. As scientists have said all along - wearing a mask and social distancing is the best defense we have against this pandemic.

We Are Not Afraid

| Comments

Volkswagen CEO Deiss is not afraid of an Apple Electric car.

Germany’s Volkswagen is not concerned by any Apple plans for a passenger vehicle that could include the iPhone maker’s battery technology, its chief executive Herbert Diess said.

[...]

“The car industry is not a typical tech-sector that you could take over at a single stroke,” Diess was quoted as saying an interview with Frankfurter Allgemeine Sonntagszeitung. “Apple will not manage that overnight,” he added.

While Apple’s plans are not public, Diess said its intentions as such were “logical” because the company had expertise in battderies, software and design, and that it had deep pockets to build on these competencies.

“Still, we are not afraid,” he said.

Hmm. Where have we heard this before? Lets back track to 2006, a few months before the announcement of the iPhone. Palm CEO Ed Colligan’s remarks:

We’ve learned and struggled for a few years here figuring out how to make a decent phone. PC guys are not going to just figure this out. They’re not going to just walk in

Let us not forget Microsoft CEO on the introduction of the iPhone.

$500 fully subsidized? With a plan? I said that is the most expensive phone in the world and doesn’t appeal to business customers because it doesn’t have a keyboard. Which makes it not a very good email machine.

We have a video of trail of that one:


Both Palm and Microsoft left the mobile cell phone business soon after.

Whatever Apple’s first electric car introduction is, it will probably won’t be the best. That misses the big picture.

When Apple enters a market, they rarely have the best product. In many key specs, it is inferior. The very first Apple II computer, it wasn’t the cheapest or the fastest. But it was a completely assembled machine that was well designed and worked out of the box. For the Macintosh, they re-imagined how users interacted with the computer. With the iPhone, they didn’t release a new phone. They released a Unix based pocket computer with a phone app.

Apple just does not enter a market, they re-imagine the market place and tilt it to their advantage . Volkswagen CEO Deiss should be afraid. Very afraid.

Flipping Red States

| Comments

Stacey Abrams & Lauren Groh-Wargo on how they increased Democratic votes in Georgia:

Georgians deserved better, so we devised and began executing a 10-year plan to transform Georgia into a battleground state. As the world knows, President Biden won Georgia’s 16 electoral votes in November, and the January runoff elections for two Senate seats secured full congressional control for the Democratic Party. Yet the result wasn’t a miracle or truly a surprise, at least not to us. Years of planning, testing, innovating, sustained investment and organizing yielded the record-breaking results we knew they could and should. The lessons we learned can help other states looking to chart a more competitive future for Democrats and progressives, particularly those in the Sun Belt, where demographic change will precede electoral opportunity.

We realize that many people are thinking about Stacey’s political future, but right now we intend to talk about the unglamorous, tedious, sometimes technical, often contentious work that creates a battleground state. When fully embraced, this work delivers wins — whether or not Donald Trump is on the ballot — as the growth Georgia Democrats have seen in cycle after cycle shows. Even in tough election years, we have witnessed the power of civic engagement on policy issues and increases in Democratic performance. This combination of improvements has also resulted in steady gains in local races and state legislative races, along with the continued narrowing of the statewide loss margin in election after election that finally flipped the state in 2020 and 2021.

The task is hard, the progress can feel slow, and winning sometimes means losing better. In 2012, for example, we prevented the Republicans from gaining a supermajority in the Georgia House of Representatives, which would have allowed them to pass virtually any bill they wanted. We won four seats they had drawn for themselves, and in 2014 we maintained those gains — just holding our ground was a victory.

The steps toward victory are straightforward: understand your weaknesses, organize with your allies, shore up your political infrastructure and focus on the long game. Georgia’s transformation is worth celebrating, and how it came to be is a long and complicated story, which required more than simply energizing a new coterie of voters. What Georgia Democrats and progressives accomplished here — and what is happening in Arizona and North Carolina — can be exported to the rest of the Sun Belt and the Midwest, but only if we understand how we got here.

Trump Acquitted

| Comments

Former president Donald Trump was acquitted Saturday of inciting the Jan. 6 attack on the Capitol, becoming the first president in U.S. history to face a second impeachment trial — and surviving it in part because of his continuing hold on the Republican Party despite his electoral defeat in November.

That grip appeared to loosen slightly during the vote Saturday afternoon, when seven Republicans crossed party lines to vote for conviction — a sign of the rift the Capitol siege has caused within GOP ranks and the desire by some in the party to move on from Trump. Still, the 57-to-43 vote, in which all Democrats and two independents voted against the president, fell far short of the two-thirds required to convict.

What I Think of Bitcoin

| Comments

Ray Dalio channels my thoughts on bitcoin:

As an extension of Bitcoin¹ being digital are the questions of how private it is and what the government will allow and not allow it to be. Regarding privacy, it appears that Bitcoin will unlikely be as private as some people surmise. It is, after all, a public ledger and a material amount of Bitcoin is held in a non-private manner. If the government (and perhaps hackers) want to see who has what, I doubt that privacy could be protected. Also, it appears to me that if the government wanted to get rid of its use, most of those who are using it wouldn’t be able to use it so the demand for it would plunge. Rather than it being far-fetched that the government would invade the privacy and/or prevent the use of Bitcoin (and its competitors) it seems to me that the more successful it is the more likely these possibilities would be. Starting with the formation of the first central bank (the Bank of England in 1694), for good logical reasons governments wanted control over money and they protected their abilities to have the only monies and credit within their borders. When I a) put myself in the shoes of government officials, b) see their actions, and c) hear what they say, it is hard for me to imagine that they would allow Bitcoin (or gold) to be an obviously better choice than the money and credit that they are producing. I suspect that Bitcoin’s biggest risk is being successful, because if it’s successful, the government will try to kill it and they have a lot of power to succeed.