Skip to content

Instantly share code, notes, and snippets.

@punchagan
punchagan / install.sh
Last active Aug 29, 2015
A columned LEDStrip module for RPi
View install.sh
set -e
# Defaults to install where install.sh is located
INSTALL_DIR="$( cd "$(dirname "$0")" ; pwd -P )"
BUILD_DIR=${INSTALL_DIR}/BUILD
mkdir -p $BUILD_DIR
pushd $BUILD_DIR
@punchagan
punchagan / gist:836799
Created Feb 21, 2011
Archive DONE items to datetree based on CLOSED time
View gist:836799
(defadvice org-archive-subtree
(around org-archive-subtree-to-data-tree activate)
"org-archive-subtree to date-tree"
(if (org-entry-is-done-p)
(let* ((dct (decode-time
(org-time-string-to-time
(cdar (org-entry-properties nil 'special "CLOSED")))))
(y (nth 5 dct))
(m (nth 4 dct))
(d (nth 3 dct))
@punchagan
punchagan / pidgin-countdown.sh
Created Mar 28, 2011
Update pidgin status message periodically with a countdown timer.
View pidgin-countdown.sh
#!/bin/bash
upto=`date -d "Mar 30 14:30" +%s`
text="to go!"
while true; do
now=`date +%s`
count=`expr $upto - $now`
hours=`expr $count / 3600`
minutes=`expr $count % 3600 / 60`
@punchagan
punchagan / qotd.sh
Created Nov 29, 2011
Pick a random image from a directory and annotate the text message onto it.
View qotd.sh
#!/bin/bash
# Usage ./qotd.sh "This is sample text"
# Depends
# - Gnome2/3
# - ImageMagick
# TODO
# - Add intelligent font color selection
@punchagan
punchagan / customize.sh
Created Jan 19, 2012
Ubuntu Customization Script (custom package list for education/children)
View customize.sh
#!/bin/sh
# Links to pages listing interesting packages
# https://help.ubuntu.com/community/UbuntuScience
# http://www.lifehack.org/articles/technology/linux-for-children.html
# http://www.edubuntu.org/news/11.10-release (get package list?)
@punchagan
punchagan / android_lock.py
Created Jun 3, 2012
Calculate possible combinations of Android pattern lock
View android_lock.py
##############################################################################
# R - Red, B- Blue, G-Green
# We name vertices as follows:
# R B R
# B G B
# R B R
##############################################################################
@punchagan
punchagan / test.md
Created Jul 20, 2012
Testing gist.io for source code support
View test.md

Test Code here

for i in range(10):
    print i

No support for code blocks. gist.io should really be using github's markdown!

@punchagan
punchagan / scroll.el
Created Oct 5, 2012
Normal scrolling for emacs
View scroll.el
(defun bhanu/scroll-up (&optional num)
"Scroll up num number of lines."
(interactive "p")
(scroll-down num)
(previous-line num))
(defun bhanu/scroll-down (&optional num)
"Scroll down num number of lines."
(interactive "p")
(scroll-up num)
@punchagan
punchagan / issue_plot.py
Last active Oct 11, 2015
Simple script to plot Github turn around time
View issue_plot.py
#!/usr/bin/env python
from github import Github
from datetime import datetime
from pylab import plot, show, figure, legend, title, ylabel
def set_repo_name(repo_name, username):
if '/' in repo_name:
return repo_name
else:
return "%s/%s" %(username, repo_name)
@punchagan
punchagan / gh_to_csv.py
Created Oct 18, 2012
Github issues to a CSV file.
View gh_to_csv.py
#!/usr/bin/env python
# Written for an import to Pivotal Tracker
from github import Github
FMT = 'Story,Labels,Story Type,Created at,Requested By,Owned By,Description,Comment'
PT_GH_map = {
'story': 'title',
'labels': 'labels',
'story type': 'type',
You can’t perform that action at this time.