Install Homebrew
Install a few things with homebrew:
Notice that some packages give you information at the end, read it carefully. To recall that info use brew info
like this: $ brew info postgresql
$ brew install python --universal
# Author: Julien Phalip | |
# License: BSD | |
# Description: Change the current directory to the path of the given Python package. | |
function goto { | |
cd `python -c "import pkgutil; print(pkgutil.get_loader('$1').filename)"` | |
} | |
function _top_level_packages { | |
python -c "import pkgutil; print('\n'.join([name for loader, name, ispkg in sorted(pkgutil.iter_modules()) if ispkg]))" |
""" | |
Add copy to clipboard from IPython! | |
To install, just copy it to your profile/startup directory, typically: | |
~/.ipython/profile_default/startup/ | |
Example usage: | |
%clip hello world | |
# will store "hello world" |
import logging | |
import json | |
#logging.basicConfig(level=logging.DEBUG) | |
from oauth2client import client | |
import gdata.apps.service | |
from jwt_util import get_JWT, get_service_private_key, get_clientSecrets | |
import os | |
import subprocess | |
import atexit | |
import signal | |
from optparse import make_option | |
from django.conf import settings | |
from django.core.management.base import BaseCommand | |
from django.core.management.commands.runserver import Command as RunserverCommand |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
Install Homebrew
Install a few things with homebrew:
Notice that some packages give you information at the end, read it carefully. To recall that info use brew info
like this: $ brew info postgresql
$ brew install python --universal
# Author: Ahmed Al Hafoudh <[email protected] | |
# | |
# Usage: ruby stickies-to-notes.rb | |
# | |
# Prerequisites: | |
# gem install rb-appscript | |
# | |
require 'appscript' | |
require 'osax' |
// grab your file object from a file input | |
$('#fileInput').change(function () { | |
sendFile(this.files[0]); | |
}); | |
// can also be from a drag-from-desktop drop | |
$('dropZone')[0].ondrop = function (e) { | |
e.preventDefault(); | |
sendFile(e.dataTransfer.files[0]); | |
}; |
SELECT nspname || '.' || relname AS "relation", | |
pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size" | |
FROM pg_class C | |
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) | |
WHERE nspname IN ('public') | |
AND C.relkind <> 'i' | |
AND nspname !~ '^pg_toast' | |
ORDER BY pg_total_relation_size(C.oid) DESC |
{ | |
"id": "base", | |
"packages": { | |
"ruby1.8-dev": "", | |
"swig": "", | |
"libssl-dev": "", | |
"git-core": "", | |
"tmux": "", | |
"sysstat": "", | |
"tcpdump": "", |