In other ways too the day was a revelation to Neel. He had never witnessed a battle before and was profoundly affected by what he saw. Thinking about it later he understood that a battle was a distillation of time: years and years of preparation, decades of innovation and change were squeezed into a clash of very short duration. And when it was over the impact radiated backwards and forwards through time, determining the future and even, in a sense, changing the past, or at least the general understanding of it. It astonished him that he had not recognized before the terrible power that was contained within these wrinkles in time -- a power that could mould the lives of those who came afterwards for generation after generation. He remembered how, when reading of long-ago battles like Panipat and Plassey, he had thought of them as immeasurably distant from his own life, a matter of quaint uniforms and old-fashioned weaponry. Only now did it occur to him that it was on battlefields such as those that his own pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i this_here.gif -vcodec h264 -y -pix_fmt yuv420p that_there.mov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "rubygems" | |
require "twitter" | |
require "json" | |
require "faraday" | |
# things you must configure | |
TWITTER_USER = "your_username" | |
# get these from dev.twitter.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess as sp | |
import numpy as np | |
import signal | |
from PIL import Image | |
### TUKEY WINDOW | |
# https://leohart.wordpress.com/2006/01/29/hello-world/ | |
def tukey_window(window_length, alpha=0.5): | |
# Special cases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
import glob | |
import numpy as np | |
### TUKEY WINDOW | |
### https://leohart.wordpress.com/2006/01/29/hello-world/ | |
def tukey_window(window_length, alpha=0.5): | |
# Special cases | |
if alpha <= 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "twitter" | |
# get these from apps.twitter.com | |
CONSUMER_KEY = "abcd" | |
CONSUMER_SECRET = "abcd" | |
OAUTH_TOKEN = "abcd" | |
OAUTH_TOKEN_SECRET = "abcd" | |
TWITTER_USER = "your_username" # needs to be the one associated with keys above |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for when you have a bunch of images in a dir that are not *quite* | |
# numbered the way ffmpeg wants them to be, e.g. | |
# image-1, image-2, ... image-10, image-11, ... image-100, image-101 | |
if ARGV.length < 1 | |
puts "Usage: ruby makevideo.rb name-of-directory-with-all-your-dang-images-in-it" | |
exit | |
end | |
dir = ARGV[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for functions.php | |
function em_dash_filter($content) { | |
# add to css: .nobr { whitespace: nowrap; } | |
return preg_replace('/(\w+)(—|—|—)/', '<span class="nobr">$1$2</span><wbr>', $content); | |
} | |
add_filter( "the_content", "em_dash_filter" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Don't hyphenate very or an -ly adverb in a compound modifier. For example, a very good time, an easily remembered rule. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=begin README | |
Here's what this script does: | |
1. checks a Gmail inbox | |
2. finds attachments (which it expects to be WAV files) | |
3. pipes them through Google's voice transcription service | |
4. emails you the results | |
I use it with the Instacorder iPhone app for a super-fast, push-to-talk |