Skip to content

Instantly share code, notes, and snippets.

View zeke's full-sized avatar
🍊
Busy! @-message me directly if I'm slow to respond.

Zeke Sikelianos zeke

🍊
Busy! @-message me directly if I'm slow to respond.
View GitHub Profile
@zeke
zeke / GIF-Screencast-OSX.md
Created November 8, 2015 01:43 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@watson
watson / README.md
Last active July 13, 2023 22:42
A list of search and replace unix commands to help make a node repository 'standard' compliant

The standard code style linter is a great tool by Feross - check it out!

Remove trailing semicolons:

find . -path ./node_modules -prune -o -type f -name '*.js' -exec sed -i '' -e 's/;$//' {} \;

Ensure space between function and opening bracket:

@dgraham
dgraham / anchor.js
Last active October 5, 2015 03:15
Simulate browsers' scroll-to-anchor behavior on page load.
(function() {
function hashchange() {
if (!location.hash) {
return;
}
// Don't do anything if the current target exists.
if (document.querySelector(":target")) {
return;
}
var name = "user-content-" + decodeURIComponent(location.hash.slice(1));
@isaacs
isaacs / blerg.js
Last active August 29, 2015 14:10
/**package
{"name":"just-a-gist-package-nbd-whatevs","version":"1.2.3",
"description":"showoff",
"repository":"https://gist.github.com/2e776d98951973c8b857.git"}
**/
module.exports = "just a gist pkg nbd whatevs"
npm () {
if [ "$1" = "publish" ]; then
dependency-check . && $(which npm) "$@"
else
$(which npm) "$@"
fi
}

What zoom level is equivalent to a given altitude? In other words, if I’m looking at a map at ZL n, how high off the ground would I be to make out the same features?

This is from a question from Eric Fischer; my algebra and arithmetic are extremely rusty, so please check everything! Major assumptions:

  1. We’re at the equator.

  2. We’re looking straight down (which you can’t realistically do out a plane window, for example).

  3. We have 20/20 vision (which is not as good as median corrected vision).

@jclem
jclem / gifify.sh
Last active December 11, 2015 16:19
Shell script for turning .mov files into .gifs and posting to Cloudapp
#!/bin/bash
function printHelpAndExit {
echo 'Usage:'
echo ' gifify -coux filename'
echo ''
echo 'Options: (all optional)'
echo ' c CROP: The x and y crops, from the top left of the image, i.e. 640:480'
echo ' o OUTPUT: The basename of the file to be output (default "output")'
echo ' u: Upload the resulting image to CloudApp'
@zeke
zeke / 0_silent_selector_grid.scss
Created May 16, 2012 06:42 — forked from chriseppstein/0_silent_selector_grid.scss
This gist describes a new feature we're experimenting with for Sass 3.2: placeholder selectors. They do not get generated into your output, but they can be used like a class and extended like one.
$gutter: 10px;
$grid-unit: 60px;
%clearfix {
*zoom: 1;
&:after {
content: "\0020";
display: block;
height: 0;
clear: both;
@mathias
mathias / buttons.coffee
Created January 30, 2012 15:31
Haml + Coffeescript Tweet button and Like button
((d, s, id) ->
js = undefined
fjs = d.getElementsByTagName(s)[0]
return if d.getElementById(id)
js = d.createElement(s)
js.id = id
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"
fjs.parentNode.insertBefore js, fjs
) document, "script", "facebook-jssdk"
@zobar
zobar / gist:1499822
Created December 20, 2011 01:39
Running a Cinch IRC bot on Heroku
  1. Add Heroku to your Gemfile and bundle install.
  2. Create your Heroku app. This will only work with their (currently-beta) 'cedar' stack, so you have to heroku create --stack=cedar.
  3. Create a Procfile for your bot. This tells Heroku how to run your worker. In our case, the bot is bot.rb, so the only line in the Procfile is cinch: bundle exec ./bot.rb
  4. Commit and push to Heroku.
  5. You do not want a Web worker running, so heroku scale web=0 cinch=1. This also sets up your deployments to restart the bot.