This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Edit your cygwin files in notepad++, the best windows editor. | |
# Vim and emacs don't seem to work too well in cygwin. | |
ROOT_DIR_WINDOWS=D:\\\\cygwin | |
expandToWindows() { | |
y=`echo $1| sed -e 's/\//\\\\/g'` | |
echo $ROOT_DIR_WINDOWS\\$y | |
} | |
expArg=`expandToWindows $1` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
names: ["java"], | |
arguments: [{role: "object", | |
nountype: noun_arb_text, | |
label: "search criteria"}], | |
icon: "http://www.sun.com/favicon.ico", | |
preview: "Searches The Java 6 API.", | |
help: "Enter the name of the Java class or package for which you would like to see the documentation.", | |
author: {name: "KS", email: "[email protected]"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Pydoc.js | |
* Author: Prasanna Gautam | |
* Purpose: Search pydoc for terms from the browser | |
* You could replace it with your pydoc running on localhost if you want to search your packages. | |
*/ | |
CmdUtils.CreateCommand({ | |
names: ["pydoc"], | |
description: "Searches for python documentation for the term you're searching for", | |
arguments: [{role: 'object', nountype: noun_arb_text}], | |
author: "Prasanna Gautam", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Author: Prasanna Gautam | |
Purpose: Get all the jar files in the current working directory and put them in the jython path so that the packages can be imported. | |
""" | |
import sys | |
import glob | |
currDir = sys.currentWorkingDir() | |
sys.path.append(map(lambda x: currDir+"/"+x, glob.glob('*.jar'))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Search Links in markdown files | |
# Author: Prasanna Gautam | |
# Usage: search-link.py <regular-expression> | |
# | |
import sys | |
import glob | |
import re | |
linksDict = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tar -czvf backup.tar.gz --exclude-from=/tmp/exclude . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
LoadFromGladeFile.py | |
Description: load the glade file easily | |
Author: Prasanna Gautam | |
Info: Works with libglade for the .glade file | |
""" | |
import sys | |
import pygtk | |
pygtk.require('2.0') | |
import gtk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Hide read news posts | |
// @namespace http://nextdoorhacker.com/projects | |
// @include http://news.ycombinator.com/ | |
// @include http://slashdot.org/ | |
// @include http://www.reddit.com/* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js | |
// ==/UserScript== | |
(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Show all assignments moodle | |
// @namespace http://nextdoorhacker.com/projects | |
// @include http://bowtie.cc.trincoll.edu/course/view.php?id=408 | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js | |
// ==/UserScript== | |
jQuery("li:has(a)", "tr.section:even").each(function(index,value){ | |
var link = jQuery(this).find("a").attr("href"); | |
var loc = jQuery(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; A snake program adapted from Stewart Halloway's Programming Clojure | |
; Author: Prasanna Gautam | |
(ns reader.snake | |
(:import (java.awt Color Dimension) | |
(javax.swing JPanel JFrame Timer JOptionPane JLabel) | |
(java.awt.event ActionListener KeyListener)) | |
(:use clojure.contrib.import-static [clojure.contrib.seq-utils :only (includes?)])) | |
(import-static java.awt.event.KeyEvent VK_LEFT VK_RIGHT VK_UP VK_DOWN) | |
(def width 75) |