Skip to content

Instantly share code, notes, and snippets.

@nkabardin
nkabardin / README
Created May 3, 2011 14:22
Erlang xmerl-based simple xml parsing
# Example xml
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
<application id="test">
<platform id="vk">
<appId>123</appId>
<secretKey>secret</secretKey>
<packages>
<package id="vk0" price="100" points="3" />
%% @author Ian Wilkinson
%% @doc interval_tree presents an Interval Tree where keys can be associated with intervals.
%% Furthermore, when instantiating the Interval Tree, you can indicate whether the low or high endpoints
%% can be half-open, or closed.
%%
%% It may be worth investigating <a href="http://www.soi.city.ac.uk/~ross/papers/FingerTree.html">Finger Trees</a>
%% as a possible alternative to Red-Black trees for implementing the Interval Tree.
%%
%% @reference <a href="http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=11866">
%% Introduction to Algorithms</a>
@danpal
danpal / Installing authy-ssh
Created August 28, 2012 17:25
Installing authy-ssh
Installation.
$ curl 'https://raw.github.com/authy/authy-ssh/master/authy-ssh' -o authy-ssh
$ sudo bash authy-ssh install /usr/local/bin
$ sudo /usr/local/bin/authy-ssh enable `whoami` <your-email> <your-country-code> <your-cellphone>
$ authy-ssh test
$ sudo service ssh restart
@tempire
tempire / ow ith ojo!
Created September 11, 2012 06:01 — forked from jadeallenx/gist:3694498
tunes.io downloader oneliner
perl -MTime::Piece -Mojo -E 'mkdir $dir=$ENV{HOME}."/Dropbox/tunes.io/".localtime->ymd; say $_->text and g($_->attrs("href"))->content->asset->move_to("$dir/${\$_->text}.mp3") for g("tunes.io")->dom("ul a")->each'
@jadeallenx
jadeallenx / ow ith ojo
Created September 11, 2012 19:50 — forked from tempire/ow ith ojo!
tunes.io downloader oneliner
perl -C -S -MTime::Piece -Mojo -E '$i=1; mkdir $dir=$ENV{HOME}."/Dropbox/tunes.io/".localtime->ymd; say $_->text and g($_->attrs("href"))->max_message_size(25600000)->content->asset->move_to("$dir/${\$i++} ${\$_->text}.mp3") for g("tunes.io")->dom("ul a")->each'
@glenbot
glenbot / due_dates.py
Last active December 10, 2015 14:08
Due Date Notifier - Notify VIA SMS (SendHub) when a bill is going to be due
#!/usr/bin/env python
# Due Date Notifier - Notify VIA SMS (SendHub) when a bill is going to be due
# * Requires a SendHub account (free) - http://sendhub.com
# * Has python package dependencies: simplejson, requests
# * Recommend putting this on a crob job running once a day
# I like my text messages at at 11am
#
# NOTE: Sendhub free accounts allow only 500 requests to the API per month.
# This should suffice assuming the amount of bills you pay arent loco.
#
@gnarf
gnarf / ..git-pr.md
Last active April 12, 2024 22:00
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet
@russelldb
russelldb / gist:7596268
Created November 22, 2013 07:39
riak-erlang-client counter usage
1> {ok, Pid} = riakc_pb_socket:start_link("localhost", 8087).
{ok,<0.35.0>}
2> riakc_pb_socket:set_bucket(Pid, <<"foo">>, [{allow_mult, true}]).
ok
3> riakc_pb_socket:counter_incr(Pid, <<"foo">>, <<"bar">>, 1).
ok
4> riakc_pb_socket:counter_incr(Pid, <<"foo">>, <<"bar">>, 3).
ok
5> riakc_pb_socket:counter_incr(Pid, <<"foo">>, <<"bar">>, -2).
ok
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active June 16, 2024 13:44
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results