Skip to content

Instantly share code, notes, and snippets.

View nootrope's full-sized avatar
💭
Pushing bits

Alberto Gaitán nootrope

💭
Pushing bits
  • planet earth
View GitHub Profile
@mxcl
mxcl / uninstall_homebrew.sh
Created August 26, 2011 11:25
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

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
@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@lanesgists
lanesgists / hack.sh
Last active October 8, 2015 18:18 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@johnschimmel
johnschimmel / jsonify_route.py
Created November 6, 2012 16:12
Sample Flask route to create JSON from Dictionary
from flask import jsonify
@app.route('/data/ideas')
def data_ideas():
# query for the ideas - return oldest first, limit 10
ideas = models.Idea.objects().order_by('+timestamp').limit(10)
if ideas:
@timball
timball / ssh_attach.sh
Created December 28, 2012 19:00
ssh_attach is to be sourced from a .profile and connects your shell to previously running ssh-agents . think of it as a slightly functional keymanager for your ssh sessions . --timball
#!/bin/bash
#
# ssh_attach.sh
#
# source this file in a .bashrc .
#
# something like :
#
# # interactive shell ??
# if [ "$PS1" ]; then
@DavidWells
DavidWells / javascript-query-string.js
Created January 16, 2013 00:55
JavaScript :: Regex trick: Parse a query string into an object
// http://stevenbenner.com/2010/03/javascript-regex-trick-parse-a-query-string-into-an-object/
// JavaScript regex trick: Parse a query string into an object
var queryString = {};
anchor.href.replace(
new RegExp("([^?=&]+)(=([^&]*))?", "g"),
function($0, $1, $2, $3) { queryString[$1] = $3; }
);
// Usage
@allegrem
allegrem / connect-pi.sh
Last active April 17, 2018 04:42
A little script which retrieves the MAC and IP addresses of the first active Raspberry Pi on the local network, and then connects to it through SSH.
#!/bin/bash
#Get the IP address of the Raspberry Pi and connect to it through SSH.
echo "*************** CONNECT-PI ***************"
echo "* /!\ You must reboot the Raspberry Pi *"
echo "* now in order to make this script work. *"
echo "******************************************"
echo
echo -n "Getting MAC address... "
@DavidWells
DavidWells / debug-inbound-now-forms.js
Created March 7, 2014 01:05
Run the script in the console tab of the browser dev tools. This will disable the final form submission and output the ajax POST data for debugging
jQuery('form').each(function(){
jQuery(this).addClass('inbound-debug');
});