Skip to content

Instantly share code, notes, and snippets.

# Save a copy of this file to the backup directory
THEDATE=`date +"%Y%m%d"`
THETIME=`date +"%H%M%S"`
filedata=`cat`
mkdir -p "$TM_BACKUP_DIR/$THEDATE"
echo "$filedata" > "$TM_BACKUP_DIR/$THEDATE/$TM_FILENAME.$THEDATE.$THETIME.backup"
@myobie
myobie / mountain-lion-brew-setup.markdown
Created February 18, 2012 20:14
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@justinkelly
justinkelly / _config.yml
Created March 21, 2012 01:17
Update posterous migrator for jekyll/octopress that maintains url slug
# To maintain your posterous links use the below permalink config
# ----------------------- #
# Jekyll & Plugins #
# ----------------------- #
permalink: /:title/
@rdeaton
rdeaton / gist:2838397
Created May 30, 2012 19:20
Sprite Ideas
Alternative forms of collision detection
- Possible use of algorithms like quadtrees and spatial hashing
Positioning based on tuples/numpy arrays vs Rects
Anchor points
Improved layering system
"Automated" dirty rendering
A Group which implements the Sprite protocol (aggregate sprites)
Properties which change sprites in various ways:
- angle of rotation
- scale (zoom in or out)
@danparsons
danparsons / gist:3195652
Created July 29, 2012 01:46
How to stream the London 2012 Olympics

How to stream the London 2012 Olympics

There have been several HOWTOs posted regarding streaming the 2012 Olympics using HTTP / SOCKS proxies via SSH and other similar methods. None of these actually work using the latest Flash on Mountain Lion (with Firefox, Chrome or Safari). Additionally, the third-party streaming sites don't provide BBC's amazing interface, which lets you quickly skip to individual competitors and events. However, setting up an OpenVPN server does work, with some tweaks. You'll get the exact same UX that people in England receive.

@MrSwitch
MrSwitch / saveAs.js
Created August 31, 2012 13:55
FileSaver window.saveAs shim
// window.saveAs
// Shims the saveAs method, using saveBlob in IE10.
// And for when Chrome and FireFox get round to implementing saveAs we have their vendor prefixes ready.
// But otherwise this creates a object URL resource and opens it on an anchor tag which contains the "download" attribute (Chrome)
// ... or opens it in a new tab (FireFox)
// @author Andrew Dodson
// @copyright MIT, BSD. Free to clone, modify and distribute for commercial and personal use.
window.saveAs || ( window.saveAs = (window.navigator.msSaveBlob ? function(b,n){ return window.navigator.msSaveBlob(b,n); } : false) || window.webkitSaveAs || window.mozSaveAs || window.msSaveAs || (function(){
@elentok
elentok / nginx.conf
Created June 24, 2013 11:07
Redirect favicon.ico, robots.txt, 500/404/422.html to public
server {
listen 80;
server_name subdomain.domain.com;
location ~* ^/(favicon.ico|robots.txt|500.html|404.html|422.html)$ {
root /home/rails/website/current/public;
try_files $uri =404;
}
}
@benschwarz
benschwarz / .bowerrc
Last active April 3, 2019 07:55
Bower + Rails asset pipeline
{
"directory": "vendor/assets/components"
}
@mpeteuil
mpeteuil / rubocop_pre_commit_hook
Created August 3, 2013 17:44
Ruby style guide git pre-commit hook using Rubocop as the style guide checker. Only runs on staged ruby files that have been added and/or modified.
#!/usr/bin/env ruby
require 'english'
require 'rubocop'
ADDED_OR_MODIFIED = /A|AM|^M/.freeze
changed_files = `git status --porcelain`.split(/\n/).
select { |file_name_with_status|
file_name_with_status =~ ADDED_OR_MODIFIED
@guilleiguaran
guilleiguaran / application-9f8b759dfbefae75069a6cefd9d13932.css
Created January 22, 2014 16:55
Sprockets preprocessor for asset paths
body{background-image:url("/assets/background-0539f790ccc171714d5ad38f5524423e.jpg")}