Skip to content

Instantly share code, notes, and snippets.

View jishnu7's full-sized avatar
🤷‍♂️

Jishnu Mohan jishnu7

🤷‍♂️
View GitHub Profile
@jishnu7
jishnu7 / pre-commit.sh
Created September 24, 2015 10:44
pre-commit hook for pep8
#!/bin/sh
FILES=$(git diff --cached --name-status | grep -v ^D | awk '$1 $2 { print $2}' | grep -e .py$)
if [ -n "$FILES" ]; then
pep8 -r $FILES
fi
@jishnu7
jishnu7 / tutorial_build.js
Created July 3, 2014 09:35
building tutorial
tutorial.build({
// parent view
superview: this,
// screen name - used to get tutorial from data
type: "map_screen",
// milestone number - to identify tutorial
milestone: this._currentId,
// timeout for tutorial to start.
timeout: 1000,
// disable events to this view and sub view when tutorial is visible/processing
@jishnu7
jishnu7 / tutorial_data_1
Last active August 29, 2015 14:03
Tutorial module
{
// screen
map_screen: {
// milestone number
1: [
{
id: 'milestone',
text: 'Welcome! Tap on Milestone-1 to start playing.'
},
{

Using bitlbee with HipChat

Initial setup

  • account add jabber [email protected] 'PASSWORD'
  • account hipchat set nick_source full_name
  • account hipchat set resource bot
  • account hipchat on
@jishnu7
jishnu7 / unical_captcha.js
Last active May 6, 2022 23:09
Bookmarklet to input sum value in Calicut university results page.
javascript:(
function() {
var document = window.frames.mainFrame.document,
fst = document.getElementById('fst').value,
snd = document.getElementById('snd').value;
document.getElementById('sum').value = parseInt(fst, 10) + parseInt(snd, 10);
}
)();
@jishnu7
jishnu7 / jshint-pre-commit
Last active December 16, 2015 13:38
Pre-commit script for JSHint
#!/bin/bash
# author: [email protected]
# Pre-commit hook passing files through jshint
# Temperory staging area
TMP_STAGING=".tmp_staging"
# absolute path of this repo
ROOT_DIR=$(git rev-parse --show-toplevel)
# path of your jshint config
CONF="--config=${ROOT_DIR}/tools/jshintrc"
@jishnu7
jishnu7 / module_watcher.py
Created December 4, 2012 21:11 — forked from eberle1080/module_watcher.py
Automatically reload python module / package on file change
#!/usr/bin/env python
# Author: Chris Eberle <[email protected]>
# Watch for any changes in a module or package, and reload it automatically
import pyinotify
import imp
import os
class ModuleWatcher(pyinotify.ProcessEvent):
"""
@jishnu7
jishnu7 / input_urls
Created November 28, 2012 07:44
Speed test shell script
http://cdimage.debian.org/debian-cd/6.0.6/i386/iso-cd/debian-6.0.6-i386-netinst.iso
http://mirror.ufs.ac.za/linuxmint//stable/14/linuxmint-14-cinnamon-dvd-64bit.iso
http://cdimage.debian.org/debian-cd/6.0.6/amd64/iso-dvd/debian-6.0.6-amd64-DVD-1.iso
@jishnu7
jishnu7 / tree.md
Created May 31, 2012 12:17 — forked from hrldcpr/tree.md
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@jishnu7
jishnu7 / server.py
Created May 31, 2012 06:29
Python web server
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class ServerHandler(BaseHTTPRequestHandler):
def do_GET(self):
print "GET :",self.path
# Send success response
self.send_response(200)
self.send_header('Content-type','text/html')
self.end_headers()
# Return Data