View gist:1207002

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
View bashrc.sh
1 2 3 4 5 6 7 8 9 10
## #####################
## ## Setting Mac OS X
## ## Terminal.app name.
## ## This code goes to
## ## all your ~/.bashrc or
## ## ~/.bash_profile files.
## ## Now you can jump from
## ## machine to machine and
## ## never get lost.
## #####################
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
View xcode-build-bump.sh
1 2 3 4 5 6 7 8 9
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
View gist:5215127
1 2 3 4 5 6 7 8 9 10
Handlebars.registerHelper('currency', function(amount, options) {
if (typeof(amount) === 'string') { amount = options.contexts[0].get(amount); }
var rounded = Math.round(amount * 100);
var dec = rounded % 100;
var whole = rounded / 100 - dec / 100;
var decStr = '' + dec;
return '$' + whole + '.' + decStr + ( decStr.length < 2 ? '0' : '');
});
 
test("USD", function () {
View CustomPost.php
1 2 3 4 5 6 7 8 9 10
<?php namespace PaintedCloud\WP\Classes;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class CustomPost {
protected $textdomain;
protected $posts;
public function __construct( $textdomain )
View 0_reuse_code.js
1 2
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View git.css
1 2 3 4 5 6 7 8 9
/* Set up Git Configuration */
 
git config --global user.email "you@yourdomain.com"
 
git config --global user.name "Your Name"
 
git config --global core.editor "vi"
 
git config --global color.ui true
View build netlib-native_system-linux-x86_64-natives.jar
1 2 3 4 5 6 7 8 9 10
sudo yum install jdk-7u65-linux-x64.rpm
sudo yum install gcc
sudo yum install gcc-gfortran
sudo yum install blas lapack arpack
 
unzip netlib-java-1.1.2.zip
cd ~/netlib-java-1.1.2
sed -i "s/1.2-SNAPSHOT/1.1.2/g" `grep -rl 1.2-SNAPSHOT .`
mvn install
cd native_system/
View contours.py
1 2 3 4 5 6 7 8 9 10
# usage: `python ~/Desktop/contours.py 1994-654-12_v02.tif`
# output is to a squareless.txt file and the directory "out"
# Working well with thumbnails with 400px as their longest side - untested with other dimensions
 
# for i in $(ls -1 | grep tif); do python /Users/artsyinc/Documents/resistance/experiments/artwork_image_cropping/contours.py $i; done
 
import cv2
import numpy as np
from matplotlib import pyplot as plt
import sys
Something went wrong with that request. Please try again.