Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block jadedgnome

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
isaacs /
Last active Sep 20, 2019
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl | sh
cdown / gist:1163649
Last active Sep 18, 2019
Bash urlencode and urldecode
View gist:1163649
urlencode() {
# urlencode <string>
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:i:1}"
case $c in
[a-zA-Z0-9.~_-]) printf "$c" ;;
mopemope /
Created Oct 4, 2011
xvideos downloader
import os
from os import path
from werkzeug import secure_filename
from tobikko.core import *
from tobikko.patch import *
import urllib2
from pyquery import PyQuery as pq
import urllib
from urlparse import urlparse
aerickson /
Created Oct 13, 2011
Get total rsync progress using Python
# from
import subprocess
import re
import sys
print('Dry run:')
cmd = 'rsync -az --stats --dry-run ' + sys.argv[1] + ' ' + sys.argv[2]
proc = subprocess.Popen(cmd,
mbbx6spp /
Created Dec 4, 2011
Best UNIX shell-based tools I can't live without with example usages

Best UNIX Shell tools

These are a list of usages of shell commands I can't live without on UNIX-based systems.


Mac OS X

Using Homebrew (yes, I am opinionated) you can install the following tools with the following packages:

View gist:1552606
#! /bin/bash
# # keepalive #
# Keeps your processes running - handy quick-restart for services.
# Run a server with:
mkottman /
Last active Aug 20, 2019
A two-line colored Bash prompt (PS1) with Git branch and a line decoration which adjusts automatically to the width of the terminal. Recognizes SVN, Git and Fossil version control systems and shows the current branch/revision.
# A two-line colored Bash prompt (PS1) with Git branch and a line decoration
# which adjusts automatically to the width of the terminal.
# Recognizes and shows Git, SVN and Fossil branch/revision.
# Screenshot:
# Michal Kottman, 2012
View thread_pool.rb
# Ruby Thread Pool
# ================
# A thread pool is useful when you wish to do some work in a thread, but do
# not know how much work you will be doing in advance. Spawning one thread
# for each task is potentially expensive, as threads are not free.
# In this case, it might be more beneficial to start a predefined set of
# threads and then hand off work to them as it becomes available. This is
# the pure essence of what a thread pool is: an array of threads, all just
# waiting to do some work for you!
stefl / scrape_tweets.rb
Created Mar 25, 2012
Download all tweets from the twitter search API for a given search term (limited to their maximum of 1500)
View scrape_tweets.rb
#! /usr/bin/env ruby
require "fileutils"
search_term = ARGV[0]
if search_term
time =
directory_path = File.dirname(__FILE__) + "/tweets/" + search_term + "_" + time.to_i.to_s
directory =
(1..15).each do |i|
`curl "{search_term}&rpp=100&page=#{i}&include_entities=true&result_type=mixed" > #{directory.path}/#{i}.json`
You can’t perform that action at this time.