Skip to content

Instantly share code, notes, and snippets.

@Jupiterrr
Jupiterrr / git-rebase-edit
Last active May 28, 2016 19:43
git-rebase-edit - helper for editing old commits via `rebase -i`
#!/usr/bin/env bash
set -e
if [ "$#" -ne 1 ]; then
echo "Usage: git edit REV"
exit
fi
# CHECK SHA AND PARSE IT
#!/bin/sh
set -u # prevent unbound variables
set -e # terminate on error
PORT=63105
# cat bin/deploy.seash | xargs -0 tmux send -t 0
echo "uploading"
@Jupiterrr
Jupiterrr / heroku_deploy.rake
Created September 27, 2012 19:29 — forked from michaeldwan/heroku_deploy.rake
Simple Rake task for customizing deployment to Heroku
# List of environments and their heroku git remotes
ENVIRONMENTS = {
:staging => 'myapp-staging',
:production => 'myapp-production'
}
namespace :deploy do
ENVIRONMENTS.keys.each do |env|
desc "Deploy to #{env}"
task env do
@Jupiterrr
Jupiterrr / gist:2329193
Created April 7, 2012 14:01 — forked from sowenjub/gist:1033876
Quickly dump your heroku production database and load it locally
#!/bin/bash
# This script does the following:
# 1/ capture and download the latest backup
# 2/ load it to your local database
# 3/ run your app and open Safari
# Just replace any uppercase string with your own data
#
module Watchable
def events
@events ||= Hash.new { |h,k| h[k] = [] }
end
def fire event, *args
events[event].each { |e| e[*args] }
end
def on event, &block
@Jupiterrr
Jupiterrr / LICENSE.txt
Created August 22, 2011 15:51 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
[
{
_id: 15,
result: [
{
name: ["Berlin", "Deutschland"],
latlng: [50, 48]
},
...
]
@Jupiterrr
Jupiterrr / sync.sh
Last active August 29, 2015 14:11
This script syncs the current directory to /home/docker/share on a boot2docker vm.
#!/bin/bash
set -u # prevent unbound variables
set -e # terminate on error
SSH_PORT=$(boot2docker config 2>&1 | awk '/SSHPort/ {print $3}')
# install rsync
boot2docker ssh tce-load -wi rsync

Screencapture and animated gifs

I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).

Capturing (Easy)

  1. Launch quicktime player
  2. do Screen recording

screen shot 2014-10-22 at 11 16 23 am

%! Data
generation([9, 10, 21, 20, 7, 11, 4, 15, 7, 7, 14, 5, 20, 6, 29, 8, 11, 19, 18, 22, 29, 14, 27, 17, 6, 22, 12, 18, 18, 30]).
overhead([21, 16, 19, 26, 26, 7, 1, 8, 17, 14, 15, 25, 20, 3, 24, 5, 28, 9, 2, 14, 9, 25, 15, 13, 15, 9, 6, 20, 27, 22]).
budget(2912).
%! Helper
zip([], [], []).