Prettier is a code formatter, great for following consistent coding conventions with 0 effort. Here’s how to add it to TextMate, my text editor of choice. Install Prettier Globally, so you take advantage of it in any old directory. npm install –global prettier If that doesn’t work, you probably need to install Node first. So […]
Inline scripts are synchronous. “Well, duh!” you may say. That’s a feature, not a bug. Because accessing a variable after an inline script should succeed. And that’s fine. But not great. When is this bad? Well, inline scripts cause stylesheets to be blocking. Wait, what? Steve explained it 10 years ago, and it’s still relevant […]
User styles have been around since the early days of the web. They are a way for users to specify their browsing preferences using CSS cascade. I remember way back when this option was fairly prominent in Internet Explorer settings. Now, I don’t even know how to find it in most browsers. But I did […]
Instead of running ESLint on the command line and passing files to it, I wanted to require() and use it with code from strings. That is because I want to lint and unit-test the code from the book I write in AsciiDoc. (Will post the complete script once it’s running properly, some taste) Had to […]
I started typing an answer to a question by @alexharrisonsax since my React book is written for the recent past (React 14) and things change. Twitter is not great for code discussions, so here goes. Import dependencies import React, {Component, Node} from ‘react’; Declare the component class App extends Component {} Unless it’s functional stateless […]
I was just admiring Tim Kadlec eye-pleasing site. Nice, simple, see what I’m talkin’ ’bout. The feature I liked most was the footer that said “This page loaded in 0.186 seconds”. First of all – fast! Second – I thought all sites should have that. And what better way than an on-demand bookmarklet you carry […]
A quick survey… So my onlinemusictools.com is a bunch of little React apps. I was wondering – is the JS-generated content of the apps visible in search engines? A quick survey was in order. The answer is – out of Google, Bing, DuckDuckGo, Yandex, only Google search crawler speaks the lingua JavaScript. Google screenshot below. […]
Finally managed to cobble together an index page for the bunch of tools I’ve been hacking on in the past year as I progress through my music education. Is it better UX than the Apache default file listing? Hmm… Say hello to onlinemusictools.com! Not the best domain name, I know. But everything is bloody taken […]
Update: Now in French too Update 2: and in German Update 3: now with Web Speech API (scroll to the bottom) Here’s a little app that gives you flashcards of Italian words used in music: https://www.onlinemusictools.com/italiano/ It also pronounces the words in four different voices. The code for the tool: https://github.com/stoyan/italiano A few implementation notes […]
How to kill an hour on a Mac on a rainy afternoon? open Terminal.app say -v ? (to list all the voices installed) or say -v ? | grep en_ (for English-only) say -v Fred Fitter. Happier. More productive. Replace Fred with Yuri. Repeat. And if you want more voices, or better ones (some do […]
Here’s how to mix three audio files into one: ffmpeg -i alex.aiff -i fred.aiff -i whisper.aiff -filter_complex “[0:0][1:0] amix=inputs=3:duration=longest” out.mp3 Note the inputs=3 part as we’re mixing three files. And this mixes only two files putting one on the left and one on the right: ffmpeg -i alex.aiff -i fred.aiff -filter_complex amerge out.mp3
MVSMT for short… yeah, like this is going to catch up. So anyway. Before starting publishing the Web Performance Calendar this year I though: hey, them articles should show up nicer when shared in the most Social of Medias. You know, a big ol’ image and that. (It’s not really how I talk actually, even […]
Speech-to-text, eh? I wanted to convert episodes of my favorite podcast so their invaluable content is searchable. I’m moderately excited with the results but I’d like to document the effort nonetheless. DeepSpeech First thought – what open-source packages exist out there? Checking out wikipedia I see a brand-new one from Mozilla – DeepSpeech. Intriguing. Install […]
Helloooo! It’s time to sit down and write an article for the performance calendar. You have until Nov 30 to send me your piece. Details. What do you want to write about? Some ideas: Hello, 2007 called! Do I still shard domains to load resources from? Do I still package all JS in one big […]
We’ve all seen something like this: But you have no idea what the password is. How to get the human-readable version of *******? Method 1: use the browser’s developer tools Provided you have a reasonably recent browser, just open the Developer tools by right-clicking the input field with the password and then select “Inspect Element”. […]
Revert hg revert -r .^ filename What’s in a commit? hg tip -vp Forget these untracked files hg purge
Naturally, you want your lint tools integrated with your text editor. Here’s what I did to integrate Stylelint (hello!) with TextMate. New Bundle In TextMate… menu Bundles / Edit Bundles…. I didn’t see a way to add a new Command, so I right-clicked an existing one (one with a C icon for Command), selected Find […]
Stylelint is a great new modern unopinionated CSS linter. It’s a must for any project beyond test.html. After my last post about always adding generic font families I thought it should be a lint-able thing. So I looked into extending Stylelint. You can write new lint rules and tell Stylelint to use them. In my […]
TL;DR: /* WRONG */ .huh { font-family: Helvetica Neue, Helvetica, Arial; } /* OK */ .huh { font-family: Helvetica Neue, Helvetica, Arial, sans-serif; } Exhibit 1: Bing search Yeah, I use Bing search, shut up! Check this out, the ugly Times New Roman font to the right where it says Rewards: Definitely not what the […]
I’ve been trying to stay away from webfonts as much as I can. IMO they are not worth the performance complications. Font loaders, FOUT, yadda-yadda. But… it happens. Story time While showing off another one of my music theory exercises to my prof, he mentioned it would be nice to be able to tell v […]
I’m sure better tools exist, but hey, quick and dirty is faster: running a quick console thing to tell me what makes the HTML payload bigger
Maybe you’re an attacker who sneaked in a little JavaScript to an unsuspecting site and would like to, well, sneak. Or maybe you want to know what exactly all these third-party analytics scripts are “calling home”. Or maybe just for fun – wouldn’t it be cool to intercept and log all requests made with new […]
Yesterday I had to plug in my keyboard to the computer and wasn’t sure if it was working. How do I test? Well, I had to look up an older post, copy and paste some code to the console… what a drag. I though it would be cool to have a page where you can […]
mogrify (like convert) is one of the utilities that come with imagemagick. Here’s an example of how you convert a batch of pic files to jpeg. Same for png to jpeg, vice-versa, etc. $ mogrify -format jpg *.pic Boom! Next! Also see: batch convert audio/video files with ffmpeg
Here’s my new tool called intervals Play with it here. Learn about the theory behind it here. The code for the tool. What does it do? Generates a random music interval, shows it on the musical staff. You try to guess it. Clicking on the staff reveals the answer. You can also play the interval. […]