Skip to content

Instantly share code, notes, and snippets.

View theskumar's full-sized avatar

Saurabh Kumar theskumar

View GitHub Profile
@theskumar
theskumar / django_createdb.py
Last active December 15, 2015 19:39
Database setup script for django projects.
import os
import time
import MySQLdb
import psycopg2
import _mysql_exceptions
from wsgi import *
def create_dbs():
'''
@theskumar
theskumar / fabfile.py
Created April 8, 2013 11:51
fabfile for creating subprojects and tab based versions.
from fabric.api import env, run, local
from fabric.decorators import hosts, with_settings
from fabric.context_managers import cd,lcd
import OS
env.use_ssh_config = True
def create_new_job(jobname):
# This Python file uses the following encoding: utf-8
import os, sys
import datetime
from tempfile import mkstemp
from django.conf import settings
from django.db import models, connection
from django.db.models import signals
from django.db.models.fields import AutoField, DateTimeField, DateField, TimeField
from django.db.models.fields.related import ForeignKey, OneToOneField
{
"metadata": {
"name": "exercise"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@theskumar
theskumar / index.html
Created August 11, 2013 13:02
A CodePen by Saurabh Kumar. Spinning the Wheel
<section class="spin_widget">
<div class="wheel_holder">
<img src="https://dl.dropboxusercontent.com/s/p1grg6kuspaklqe/spinner-wheel_board__highlight.png?token_hash=AAFEC_xUVm6Na2aYdb0jcdC1-1q-0f3svu5uOQPwYIEu1A&dl=1" alt="" class="highlights" />
<img class="wheel" src="https://dl.dropboxusercontent.com/s/6ngd3cir5xsh0ud/spinner-wheel_board__content.png?token_hash=AAH7POtGmIwkgg0DPAXYMuEAgs_6597rp3uX7bNnd3qi-w&dl=1" alt="" />
<div class="needle"></div>
<img src="https://dl.dropboxusercontent.com/s/zacc6u68fa242no/spinner-pin.png?token_hash=AAEuCX0H3IuKOgJPT6blTpfsRgTQhjNOQY8-w5L_xOh9HA&dl=1" alt="" class="pin" />
</div>
<div class="content">
<div class="action_text">
@theskumar
theskumar / index.html
Created August 11, 2013 13:03
A CodePen by Saurabh Kumar. Spinning the Wheel
<section class="spin_widget">
<div class="wheel_holder">
<img src="https://dl.dropboxusercontent.com/s/p1grg6kuspaklqe/spinner-wheel_board__highlight.png?token_hash=AAFEC_xUVm6Na2aYdb0jcdC1-1q-0f3svu5uOQPwYIEu1A&dl=1" alt="" class="highlights" />
<img class="wheel" src="https://dl.dropboxusercontent.com/s/6ngd3cir5xsh0ud/spinner-wheel_board__content.png?token_hash=AAH7POtGmIwkgg0DPAXYMuEAgs_6597rp3uX7bNnd3qi-w&dl=1" alt="" />
<div class="needle"></div>
<img src="https://dl.dropboxusercontent.com/s/zacc6u68fa242no/spinner-pin.png?token_hash=AAEuCX0H3IuKOgJPT6blTpfsRgTQhjNOQY8-w5L_xOh9HA&dl=1" alt="" class="pin" />
</div>
<div class="content">
<div class="action_text">
@theskumar
theskumar / setup.sh
Last active October 18, 2018 03:11 — forked from ritesh-fueled/installDependenciesToCompileObjectiveCInUbuntu
Install and compile Objective-C in linux
function _print(){
echo `date`":" $1 "..."
}
_print "Installing gcc compiler for objective C"
sudo apt-get install gnustep gnustep-devel gobjc tree
_print "Creating a sample test project structure"
@theskumar
theskumar / Default(OSX).sublime-keymap.json
Last active December 25, 2015 01:49
Sublime Text User Keybindings
[
{ "keys": ["super+ctrl+s"], "command": "save_project_as" },
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" },
// Toggle word wrap
{
"keys": ["alt+w"],
"command": "toggle_setting",
"args":
@theskumar
theskumar / exceptions.py
Last active January 16, 2020 01:24
User Management in django 1.5 and tastypie
import json
from tastypie.exceptions import TastypieError
from tastypie.http import HttpBadRequest
class CustomBadRequest(TastypieError):
"""
This exception is used to interrupt the flow of processing to immediately
return a custom HttpResponse.

Keybase proof

I hereby claim:

  • I am theskumar on github.
  • I am theskumar (https://keybase.io/theskumar) on keybase.
  • I have a public key whose fingerprint is 01C6 FD56 20FD 3FB4 C76E 0F8E 5AF3 6615 5E77 1692

To claim this, I am signing this object: