Skip to content

Instantly share code, notes, and snippets.

import sys
from urllib import urlencode
import requests
from urlparse import urlparse, parse_qs
from random import choice
import re
self_id = None # your facebook id here
utc_bday = None # utc timestamp of your birthday
@dhruvbaldawa
dhruvbaldawa / reload_db.sh
Created February 12, 2013 10:56
Reload database script for Flask
#### I am no Bash expert, I just googled and put this script together
#### Be free to fork and post updates to this gist
#### Also, you can change the username and email below for the django superuser
DEFAULT_USER="dhruv"
DEFAULT_EMAIL="dbaldawa@enthought.com"
DEFAULT_PASS="d"
function usage
{
@dhruvbaldawa
dhruvbaldawa / reload_db.sh
Created September 20, 2012 08:20
Bash script for automating some of django database cleanup
#### I am no Bash expert, I just googled and put this script together
#### Be free to fork and post updates to this gist
#### Also, you can change the username and email below for the django superuser
DEFAULT_USER="admin"
DEFAULT_EMAIL="admin@mail.com"
DEFAULT_PASS="pass"
function usage
{
@dhruvbaldawa
dhruvbaldawa / json_decode.py
Created September 8, 2012 18:00
JSON decoding
request_dict = {}
for key, value in json_decoded_dict.iteritems():
try:
request_dict[key] = json.loads(value)
except:
request_dict[key] = value
return request_dict
@dhruvbaldawa
dhruvbaldawa / mu_result.py
Created July 15, 2012 13:50
MU Result Checking Script
import urllib2
import time
import tweepy
import os
# Twitter Bot Credentials
# Refer on https://dev.twitter.com
consumer_key = ''
consumer_secret = ''
access_token = ''
<HTML>
<HEAD>
<TITLE>TEST</TITLE>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
function run() {
link = 'http://ajay-pc/nisarg/my_ajay/node/1.json';
$.ajax({
url: link,
dataType: 'json',