Skip to content

Instantly share code, notes, and snippets.

View amanjeev's full-sized avatar
🦀
#![allow(me_to_explain)]

Amanjeev Sethi amanjeev

🦀
#![allow(me_to_explain)]
View GitHub Profile

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
@avaris
avaris / neighbors.py
Last active December 14, 2015 21:09
Pelican: prev/next article plugin.
from pelican import signals
"""
Neighbor Articles Plugin for Pelican
====================================
Adds ``next_article`` (newer) and ``prev_article`` (older) variables
to the articles context
Usage:
@justinmayer
justinmayer / fabfile.py
Created December 10, 2012 21:50
Example fabfile for publishing Pelican sites via Fabric
from fabric.api import *
import os
import fabric.contrib.project as project
# Local path configuration (can be absolute or relative to fabfile)
env.theme = 'themes/your-theme'
env.deploy_path = '/absolute/path/for/generated/output'
# Remote server configuration
prod = 'username@server.example.com:22'
@arvearve
arvearve / gist:4158578
Created November 28, 2012 02:01
Mathematics: What do grad students in math do all day?

Mathematics: What do grad students in math do all day?

by Yasha Berchenko-Kogan

A lot of math grad school is reading books and papers and trying to understand what's going on. The difficulty is that reading math is not like reading a mystery thriller, and it's not even like reading a history book or a New York Times article.

The main issue is that, by the time you get to the frontiers of math, the words to describe the concepts don't really exist yet. Communicating these ideas is a bit like trying to explain a vacuum cleaner to someone who has never seen one, except you're only allowed to use words that are four letters long or shorter.

What can you say?

@Nurdok
Nurdok / python_conversion.md
Last active December 16, 2022 03:45
Python Conversion

Python Number Conversion Chart

From To Expression
@paulsmith
paulsmith / verbatim_templatetag.py
Created October 25, 2011 19:03 — forked from ericflo/verbatim_templatetag.py
verbatim Django template tag
"""
jQuery templates use constructs like:
{{if condition}} print something{{/if}}
This, of course, completely screws up Django templates,
because Django thinks {{ and }} mean something.
Wrap {% verbatim %} and {% endverbatim %} around those
blocks of jQuery templates and this will try its best
@ankit
ankit / wp-code-hacks.php
Created May 7, 2011 18:10
Enabling editing Wordpress pages using Textmate Blogging Bundle
/*** Edits to wp-includes/post.php ***/
// Add this method
//
function wp_get_pages( $args = array(), $output = ARRAY_A ) {
if ( is_numeric( $args ) ) {
_deprecated_argument( __FUNCTION__, '3.1', __( 'Passing an integer number of posts is deprecated. Pass an array of arguments instead.' ) );
$args = array( 'numberposts' => absint( $args ) );
}
@cnruby
cnruby / install ncurses on macosx
Created May 7, 2011 09:05
HOW TO INSTALL ncurses on MacOSX
$ curl -O ftp://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz
$ tar -xzvf ncurses-5.9.tar.gz
$ cd ./ncurses-5.9
$ ./configure --prefix=/usr/local \
--without-cxx --without-cxx-binding --without-ada --without-progs --without-curses-h \
--with-shared --without-debug \
--enable-widec --enable-const --enable-ext-colors --enable-sigwinch --enable-wgetch-events \
&& make
$ sudo make install