Skip to content

Instantly share code, notes, and snippets.

Build your own private, encrypted, open-source Dropbox-esque sync folder

Prerequisites:

  • One or more clients running a UNIX-like OS. Examples are given for Ubuntu 12.04 LTS, although all software components are available for other platforms as well (e.g. OS X). YMMV
  • A cheap Ubuntu 12.04 VPS with storage. I recommend Backupsy, they offer 250GB storage for $5/month. Ask Google for coupon codes.

Software components used:

  • Unison for file synchronization
  • EncFS for folder encryption
@tkdave
tkdave / gist:4150916
Created November 26, 2012 21:58
Installing OpenCV python libs on mac to work with virtualenv and brew
# Installing OpenCV python libs on mac to work with virtualenv
# OpenCV 2.4.3
# Python 2.7.3 installed with brew
# assuming you have virtualenv, pip, and python installed via brew
# assuming $WORKON_HOME is set to something like ~/.virtualenvs
# using homebrew - make sure we're current
brew update
@vnorby
vnorby / gist:4116565
Created November 20, 2012 07:25
Bookmarklet to show Paul Graham's essay footnotes inline on hover
javascript:(function(e,t,n,r,i,s,o,u){if(!(i=e.jQuery)||n>i.fn.jquery||r(i)){s=t.createElement("script");s.type="text/javascript";s.src="http://ajax.googleapis.com/ajax/libs/jquery/"+n+"/jquery.min.js";s.onload=s.onreadystatechange=function(){if(!o&&(!(u=this.readyState)||u=="loaded"||u=="complete")){r((i=e.jQuery).noConflict(1),o=1);i(s).remove()}};t.documentElement.childNodes[0].appendChild(s)}})(window,document,"1.8.3",function(e,t){var n=e("font[color]").filter(function(){if(parseInt(e(this).text(),10)>0){return true}return false}).parent();var r=e("body").html();n.each(function(){var t=e(this).attr("href").replace("#","");var n=parseInt(t.replace("f",""),10);var i=new RegExp('<a name="'+t+'">([^]*?)[[]');var s=r.match(i);if(s&&s[0]){var o=e(s[0].replace("<br>","\n")).text().replace(n+"]","");o=o.replace("csell_env = 'mud';","").replace("// Begin Y! Store Generated Code","");var u=e('<div class="note" style="background:#FFFFFF;border:3px solid #000;left:0px;top:15px;width:300px;position:absolute;padding:1
@npinto
npinto / labels_to_integers.py
Created September 4, 2012 21:36
String labels to sorted 0-based integers.
In [12]: l = ['a', 'a', 'c', 'c', 'c', 'b']
In [13]: u = np.unique(l)
In [14]: u
Out[14]:
array(['a', 'b', 'c'],
dtype='|S1')
In [15]: np.searchsorted(u, l)
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@kevinpschaaf
kevinpschaaf / github_issues_to_csv_v3.rb
Created June 20, 2012 23:24 — forked from tkarpinski/github_issues_to_csv.rb
Exports Github issues to CSV (API v3)
require 'octokit'
require 'csv'
require 'date'
# Description:
# Exports Github issues from one or more repos into CSV file formatted for import into JIRA
# Note: By default, all Github comments will be assigned to the JIRA admin, appended with
# a note indicating the Github user who added the comment (since you may not have JIRA users
# created for all your Github users, especially if it is a public/open-source project:
#
@paulmillr
paulmillr / active.md
Last active April 23, 2024 17:32
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user =&gt; user.followers &gt; 1000)
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/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
#
@hrldcpr
hrldcpr / tree.md
Last active May 1, 2024 00:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@makinde
makinde / arc_setup.sh
Created February 3, 2012 21:46
Arc Setup (Ubuntu)
#!/bin/bash
if ! hash git &> /dev/null || ! hash php &> /dev/null; then
echo -e " *****\n ***** INSTALLING GIT AND PHP\n *****"
if hash apt-get &> /dev/null; then
sudo apt-get install git-core php5-cli php5-curl
elif hash port &> /dev/null; then
sudo port install php5-curl
elif hash fink &> /dev/null; then