Skip to content

Instantly share code, notes, and snippets.

View utsengar's full-sized avatar
🚀
Hustling.

Utkarsh Sengar utsengar

🚀
Hustling.
View GitHub Profile
<div id="lga">
<style>
body{overflow:hidden}#hplogo{position:relative;width:0;margin:0 auto;right:190px;height:160px}.particle{position:absolute;z-index:-1}.circle{-moz-border-radius:160px;-webkit-border-radius:160px;-khtml-border-radius:160px;border-radius:160px}#cpf,#sbl,#fctr{background:transparent}
</style>
<noscript>
&lt;style&gt;#hplogo{right:0;width:auto;background:url(/intl/en_ALL/images/srpr/logo1w.png) no-repeat center}&lt;/style&gt;
</noscript>
<div id="hplogo">
<div class="particle circle" style="background-color: rgb(237, 157, 51); height: 18.337px; width: 18.337px; left: 200.733px; top: 77.5385px;">
</div>
class Main{public static void main(String...args){\u0066or(int
\u0020$:"vÌÈÊ\"¤¾Àʲ¬Æ\"v¤Î¤\"²¤¨¸¬Æ".to\u0043h\u0061rArray()
)System./*goto/*$/%\u0126//^\u002A\u002Fout.print((char)(($>>
+(~'"'&'#'))+('<'>>('\\'/'.')/\u002Array.const(~1)\*\u002F)));}}
function! NERDTreeQuit()
redir => buffersoutput
silent buffers
redir END
" 1BufNo 2Mods. 3File 4LineNo
let pattern = '^\s*\(\d\+\)\(.....\) "\(.*\)"\s\+line \(\d\+\)$'
let windowfound = 0
for bline in split(buffersoutput, "\n")
let m = matchlist(bline, pattern)
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
@utsengar
utsengar / bootstrap.sh
Created June 2, 2011 19:00 — forked from anonymous/bootstrap.sh
Django on Heroku with Postgres, Celery and Sentry
virtualenv --no-site-packages .
source bin/activate
bin/pip install Django psycopg2 django-sentry
bin/pip freeze > requirements.txt
bin/django-admin.py startproject mysite
cat >.gitignore <<EOF
bin/
include/
lib/
EOF
@utsengar
utsengar / map_reduce.py
Created June 6, 2011 08:31
map/reduce - Python
## {{{ http://code.activestate.com/recipes/577676/ (r9)
from collections import namedtuple
from math import fsum
def map_reduce(data, mapper, reducer=None):
'''Simple map/reduce for data analysis.
Each data element is passed to a *mapper* function.
The mapper returns key/value pairs
or None for data elements to be skipped.
@utsengar
utsengar / singelton_classloader.java
Created June 14, 2011 04:13
fix singelton issues when using multiple classloaders
private static Class getClass(String classname) throws ClassNotFoundException {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
if(classLoader == null)
classLoader = Singleton.class.getClassLoader();
return (classLoader.loadClass(classname));
}
}
//Source: http://snehaprashant.blogspot.com/2009/01/singleton-pattern-in-java.html
/** The preceding method tries to associate the classloader with the current thread; if that
@utsengar
utsengar / oauth_client.py
Created July 1, 2011 00:20
oAuth client - python
"""
The MIT License
Source: https://github.com/simplegeo/python-oauth2/blob/master/example/client.py
Copyright (c) 2007 Leah Culver
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@utsengar
utsengar / osx
Created September 8, 2011 23:59
osx defaults by mathiasbynens
Source: https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Enable the 2D Dock
defaults write com.apple.dock no-glass -bool true
# Disable menu bar transparency
defaults write -g AppleEnableMenuBarTransparency -bool false
@utsengar
utsengar / decorators.py
Created October 3, 2011 01:50
Decorators as syntatic sugar to closures in Python
class Node :
def __init__(self,val,children) :
self.val = val
self.children = children
def makeRunner(f) :
def run(node) :
f(node)
for x in node.children :
run(x)