Skip to content

Instantly share code, notes, and snippets.

@coolcodr
coolcodr / ril2ip.py
Created May 7, 2012 14:16 — forked from sdb/ril2ip.py
copy bookmarks from Read It Later to Instapaper
#! /usr/bin/env python
"""
Script to copy all bookmarks from Read It Later to Instapaper.
See also http://readitlaterlist.com/api/docs/#get
and http://www.instapaper.com/api/simple
"""
import urllib, urllib2, json
@coolcodr
coolcodr / assume.py
Created July 14, 2012 08:48
A Python decorator, @Assume, it will skip the test if the condition argument is False. It works similar to org.junit.Assume.assumeTrue().
from nose.tools import nottest, istest
class assume(object):
def __init__(self, bool_condition):
self.bool_condition = bool_condition
def __call__(self, test_func):
if not self.bool_condition:
return nottest(test_func)
else:
@coolcodr
coolcodr / mate-terminal-colors-solarized.sh
Created September 2, 2012 02:08
Shell script that configures mate-terminal to use solarized theme colors.
#!/bin/sh
#
# Shell script that configures mate-terminal to use solarized theme
# colors. (I simply replaced in the original script every occurence
# of "gnome-terminal" with "mate-terminal" and every occurcence
# of "gconftool-2" with "mateconftool-2"; reverse these changes if
# using gnome and rename the script to its original name: "solarize"
#
# Written for Ubuntu 11.10, untested on anything else. (actually tested
# also on ArchLinux, seems to work fine here, tweak it to your needs :)
@coolcodr
coolcodr / gist:ae5c871a7d88d2029a8f
Created October 4, 2014 23:13
Generate Podcast RSS in Dropbox Public Folder
#!/usr/bin/env python
# coding: utf-8
import os
import PyRSS2Gen
from datetime import datetime
import urllib
class Podcast:
def __init__(self, dir_name):
var createUpdateFunc = function() {
var timer = null;
var updating = false;
repeat = function(func, interval) {
timer = setTimeout(func, interval);
}
stopRepeat = function() {
if(timer) clearTimeout(timer);
@coolcodr
coolcodr / gist:e6776ecb00d36265f29c
Last active August 29, 2015 14:07
Define a Angular Service in CoffeeScript
angular.module 'myModule'
.service 'MyService', class
constructor: ($log) ->
@doSomething = (str) ->
$log.info str
@coolcodr
coolcodr / post-receive
Created February 24, 2015 06:13
Git hook for Pivotal Tracker integration
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import urllib, urllib2
import re
import os
import subprocess
from dict2xml2 import dict2xml2
from datetime import datetime

Keybase proof

I hereby claim:

  • I am coolcodr on github.
  • I am matthewlai (https://keybase.io/matthewlai) on keybase.
  • I have a public key whose fingerprint is 8196 C41F 6EDC 3F52 8A67 7250 A4F6 0397 FAA8 2EFE

To claim this, I am signing this object:

#!/bin/bash
#
# author: orefalo
hookname=`basename $0`
FILE=`mktemp`
trap 'rm -f $FILE' EXIT
cat - > $FILE
@coolcodr
coolcodr / 0_reuse_code.js
Created April 6, 2016 15:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console