Skip to content

Instantly share code, notes, and snippets.

@amanahuja
amanahuja / keybase.md
Created October 5, 2020 17:11
keybase.md

Keybase proof

I hereby claim:

  • I am amanahuja on github.
  • I am amanqa (https://keybase.io/amanqa) on keybase.
  • I have a public key ASASllH9sUL7cRzrWMq-nIMWp7iil-P5Y3I_7ec4VcBSXwo

To claim this, I am signing this object:

@rbscott
rbscott / json_stream.py
Created September 25, 2013 02:39
Quick script to parse out fields from a JSON stream
import sys
import simplejson as json
def get_param(js, param=()):
if len(param) == 0:
return None
if len(param) == 1:
@kikocorreoso
kikocorreoso / ipynp2wp.py
Created December 1, 2012 23:58
Publish an ipynb directly in wordpress.com (proof of concept)
# -*- coding: utf-8 -*-
## Basado en el script originalmente publicado en
## http://www.jansipke.nl/using-python-to-add-new-posts-in-wordpress/
import datetime
import xmlrpclib
from xml.sax.saxutils import escape
import json
import markdown
@Miserlou
Miserlou / middleware.py
Created September 6, 2012 01:47
Django Profiler
# Orignal version taken from http://www.djangosnippets.org/snippets/186/
# Original author: udfalkso
# Modified by: Shwagroo Team and Gun.io
import sys
import os
import re
import hotshot, hotshot.stats
import tempfile
import StringIO
@stucchio
stucchio / nyc_teacher.py
Created May 26, 2012 02:51
Plots used in my "NO SCATTERPLOT" post
# Data from: http://www.ny1.com/content/top_stories/156599/now-available--2007-2010-nyc-teacher-performance-data#doereports
from pylab import *
from pandas import *
import re
def get_data(filename):
d = read_csv(filename, delimiter="\t")
d['teacher'] = d['teacher_name_first_1'] + " " + d['teacher_name_last_1']
return d
@mikedewar
mikedewar / df2json.py
Created December 16, 2011 13:17
A little script to convert a pandas data frame to a JSON object. Is there a better way?
"""
tiny script to convert a pandas data frame into a JSON object
"""
import ujson as json
import pandas
import numpy as np
df = pandas.DataFrame({
"time" : [1,2,3,4,5],
@chuanxshi
chuanxshi / mobile tags for your '<head>'
Created March 1, 2011 14:56
mobile tags for your '<head>'
<!doctype html>
<!-- Helpful things to keep in your <head/>
// Shi Chuan, https://github.com/shichuan/mobile-html5-boilerplate
-->
<head>
<!-- consider using below meta tags if you want to disable format detection by default -->
<meta name="format-detection" content="telephone=no"/>
<meta name="format-detection" content="address=no"/>
<!-- consider using below link tag if the page is duplicate content of a desktop version -->