This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from zipfile import ZipFile | |
from StringIO import StringIO | |
from PyPDF2 import PdfFileReader, PdfFileWriter | |
def burst_pages_of_pdf_file(pdf_file): | |
zipped_output = StringIO() | |
with ZipFile(zipped_output, 'w') as ziparchive: | |
pdf_file.seek(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>psjinx's Resume</title> | |
</head> | |
<body> | |
<iframe id="google-doc-iframe" srcdoc="" style="height: 1050px; margin: 0 auto;" align="middle" frameborder="0" width="100%" height="100%" scrolling="no"> | |
</iframe> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
VENV=$1 | |
if [ -z $VENV ]; then | |
echo "usage: runinenv [virtualenv_path] CMDS" | |
exit 1 | |
fi | |
. ${VENV}/bin/activate | |
shift 1 | |
echo "Executing $@ in ${VENV}" | |
exec "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type='text/javascript' src='http://www.google.co.in/jsapi'></script> | |
<script> | |
google.load('visualization', '1', { | |
'packages': ['geomap'] | |
}); | |
google.setOnLoadCallback(drawMap2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hotshot | |
import os | |
import time | |
from django.conf import settings | |
import tempfile | |
try: | |
PROFILE_LOG_BASE = settings.PROFILE_LOG_BASE | |
except: | |
PROFILE_LOG_BASE = tempfile.gettempdir() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(undefined) { | |
// Get angular app | |
var app = angular.module("App"); | |
app.factory("XLSXReaderService", ['$q', '$rootScope', | |
function($q, $rootScope) { | |
var service = function(data) { | |
angular.extend(this, data); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(undefined) { | |
'use strict'; | |
// Check if dependecies are available. | |
if (typeof XLSX === 'undefined') { | |
console.log('xlsx.js is required. Get it from https://github.com/SheetJS/js-xlsx'); | |
return; | |
} | |
if (typeof _ === 'undefined') { | |
console.log('Lodash.js is required. Get it from http://lodash.com/'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true; | |
# echo date/time | |
date; | |
do | |
# make a post request to Indian Railways PNR Enquiry page and search for "CHART NOT PREPARED" | |
if curl --silent -X POST -d "lccp_pnrno1=$1&submitpnr=Get+PNR+Status" http://www.indianrail.gov.in/cgi_bin/inet_pnrstat_cgi.cgi | grep "CHART PREPARED" | |
then | |
# Chart prepared :) | |
echo "Chart prepared. \n\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
angular.module('App', ['ng', 'ngCookies', 'ngResource']); | |
angular.module('App').run(function($rootScope, $http, $cookies) { | |
$http.defaults.headers.common['X-CSRFToken'] = $cookies.csrftoken; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.auth.models import User | |
from django.contrib.auth.hashers import make_password | |
from tastypie.authentication import ( | |
Authentication, ApiKeyAuthentication, BasicAuthentication, | |
MultiAuthentication) | |
from tastypie.authorization import Authorization | |
from tastypie.resources import ModelResource | |
from tastypie import fields |