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/python | |
# Title: Update Employee records in a plain text file | |
FILE_NAME = 'employee.txt' | |
DELIMIT = ';' | |
def prompt_values(): | |
_values = {} | |
_values['ename'] = raw_input("Employee Name: ") | |
_values['esal'] = float(raw_input("Employee Sal: ")) |
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/python | |
# Title: pythemall - Python clone of Downloadthemall | |
# Description: snippet to download direct URLs from a given page | |
__author__ = 'Abhinay Omkar' | |
from BeautifulSoup import BeautifulSoup | |
from urllib import urlopen | |
from urlparse import urlparse | |
from getopt import getopt |
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
# input: | |
# | |
# margin: 0px; | |
# padding: 0px; | |
# top: 0px; | |
# | |
# output: | |
# margin: "0px", | |
# padding: "0px", | |
# top: "0px", |
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 blank2self | |
// @namespace http://abhiomkar.in | |
// @description blank2self | |
// @include http://* | |
// @include https://* | |
// @version 0.1 | |
// ==/UserScript== | |
aTags = document.getElementsByTagName("a"); for(i=0; i< aTags.length; i++) { aTags[i].target = "_self"; } |
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 top2blank | |
// @description Set External links' target value to _blank | |
// @namespace http://abhiomkar.in | |
// @include http://* | |
// @include https://* | |
// ==/UserScript== | |
aTags = document.getElementsByTagName("a"); |
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: Abhinay Omkar | |
if(!window.console){ | |
var console = { | |
log: function(msg){ | |
throw new Error(msg); | |
} | |
} | |
} |
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
var dashes = ""; var num = 20; while(--num) dashes += "-"; setInterval(function() { window.history.pushState("", "", dashes.slice(0, num % 20) + "foo" + dashes.slice(num % 20)); num++;}, 500) |
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
#include <stdio.h> | |
int main(){ | |
printf("Hello World!\n"); | |
} |
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
function setdsm() { | |
# add the current directory and the parent directory to PYTHONPATH | |
# sets DJANGO_SETTINGS_MODULE | |
export PYTHONPATH=$PYTHONPATH:$PWD/.. | |
export PYTHONPATH=$PYTHONPATH:$PWD | |
if [ -z "$1" ]; then | |
x=${PWD/\/[^\/]*\/} | |
export DJANGO_SETTINGS_MODULE=$x.settings | |
else | |
export DJANGO_SETTINGS_MODULE=$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
# Stop Cherokee Web Server | |
sudo launchctl unload -w /Library/LaunchDaemons/org.cherokee.webserver.plist | |
# Start Cherokee Web Server | |
sudo launchctl load -w /Library/LaunchDaemons/org.cherokee.webserver.plist |