Skip to content

Instantly share code, notes, and snippets.

View matthewhartman's full-sized avatar

Matthew Hartman matthewhartman

View GitHub Profile
@artero
artero / launch_sublime_from_terminal.markdown
Last active January 25, 2024 16:57 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@vshvedov
vshvedov / gist:1370650
Created November 16, 2011 17:00
Sublime Text Edit 2 for Debian (from PPA)
wget http://blog.anantshri.info/content/uploads/2010/09/add-apt-repository.sh.txt
sudo mv add-apt-repository.sh.txt /usr/sbin/add-apt-repository
sudo chmod o+x /usr/sbin/add-apt-repository
sudo chown root:root /usr/sbin/add-apt-repository
sudo add-apt-repository ppa:webupd8team/sublime-text-2
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@liamcurry
liamcurry / gist:2597326
Created May 4, 2012 19:56
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@Kerrick
Kerrick / gist:2716568
Created May 17, 2012 05:08
HOWTO install Sublime Text 2 in Debian Squeeze
# Download Sublime Text 2 from http://www.sublimetext.com/2
# If you aren't root, sudo su
tar -xvjf Sublime\ Text\ 2*.tar.bz2
mv Sublime\ Text\ 2/ /opt/sublime-text-2/
ln -s /opt/sublime-text-2 /usr/local/sublime-text-2
ln -s /usr/local/sublime-text-2/sublime_text /usr/local/bin/sublime_text
rm Sublime\ Text\ 2*.tar.bz2
# Sublime Text 2 can now be run as normal user with command "sublime_text"
@amaxwell01
amaxwell01 / resize_delay.js
Created December 3, 2012 23:52
window resize delay
// Run code on resize, but give it a slight delay so that we aren't always calculating it
$(window).resize( function() {
if( timer ) {
clearTimeout(timer);
}
var timer = setTimeout( function() {
// On Resize Code Goes Here
}, 100 );
@grindars
grindars / steam_bootstrap.sh
Created December 7, 2012 07:53
Steam installer for Debian
#!/bin/bash
#
# Steam installer for Debian wheezy (32- and 64-bit)
#
# Place into empty directory and run.
#
download() {
local url="$1"
local filename="$(basename "$url")"
@TexRx
TexRx / vanilla-not-jquery.js
Created June 5, 2013 04:44
Pure JS alternatives to common CSS class jQuery functions
function hasClass(elem, className) {
return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');
}
function addClass(elem, className) {
if (!hasClass(elem, className)) {
elem.className += ' ' + className;
}
}
@akdetrick
akdetrick / rvm-to-rbenv.md
Last active March 15, 2024 17:06
Guide to switching to rbenv bliss from RVM hell

RVM to rbenv

Why? @sstephenson explains it best here.


1) remove RVM from your system

This should get rid of the rvm dir and any installed rubies:

$ rvm implode