Skip to content

Instantly share code, notes, and snippets.

View hemanth's full-sized avatar
🐜
🧘‍♂️

Hemanth HM hemanth

🐜
🧘‍♂️
View GitHub Profile
/* Author: Remy Sharp / @rem - adds <details> support to the browser */
(function (window, document) {
if ('open' in document.createElement('details')) return;
// made global by myself to be reused elsewhere
var addEvent = (function () {
if (document.addEventListener) {
return function (el, type, fn) {
google.pacman ||
function () {
var a = true,
e = false,
g = {},
i = [1, 4, 2, 8],
l = {
0: {
axis: 0,
increment: 0
#!/bin/bash
# If it redirects to http://www.facebook.com/login.php at the end, wait a few minutes and try again
EMAIL='YOUR_EMAIL' # edit this
PASS='YOUR_PASSWORD' # edit this
COOKIES='cookies.txt'
USER_AGENT='Firefox/3.5'
@hemanth
hemanth / git-req
Created June 25, 2010 19:33 — forked from jsocol/git-req
#!/bin/bash
# allows you to send pull requests from the command line
# usage: git req username [comparetobranch]
# or: git req username -m 'message'
# put somewhere in your PATH as git-req and make executable
usage()
{
cat << EOF
usage: $0 options
#!/bin/bash
# Sendmail replacement inspired by CheckAttach script for mutt.
# http://wiki.mutt.org/?ConfigTricks/CheckAttach for the original script.
# To use, simply add the following line to your .muttrc:
# set sendmail="/path/to/this/script"
# Then restart mutt.
# The script uses simple pattern matching to make an oninion on whether or not
Mime: {
".3gp" : "video/3gpp",
".a" : "application/octet-stream",
".ai" : "application/postscript",
".aif" : "audio/x-aiff",
".aiff" : "audio/x-aiff",
".asc" : "application/pgp-signature",
".asf" : "video/x-ms-asf",
".asm" : "text/x-asm",
".asx" : "video/x-ms-asf",
@hemanth
hemanth / factorial.py
Created June 27, 2010 09:08 — forked from ghoseb/factorial.py
factorial.py
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
# Newbie Programmer
def factorial(x)
if x == 0
return 1
else
return x * factorial(x - 1)
end
end
puts factorial(6)
puts factorial(0)
@hemanth
hemanth / gist:454786
Created June 27, 2010 09:24
Hello world from GNU pages
How the way people code “Hello World” varies depending on their age and job:
High School/Jr. High
10 PRINT "HELLO WORLD"
20 END
First year in College
program Hello(input, output)
begin
writeln('Hello World')
@hemanth
hemanth / gist:454788
Created June 27, 2010 09:28
Funny C/C++ declarations! From GNU pages
auto accident;
register voters;
static electricity;
struct by_lightning;
void *where_prohibited;
char broiled;
short circuit;
short changed;
long johns;
long dong_silver; /* Submitted by Juan Carlos Castro */