Skip to content

Instantly share code, notes, and snippets.

View seekshreyas's full-sized avatar
🐼
\_(*|*)_/

Shreyas seekshreyas

🐼
\_(*|*)_/
  • DocuSign
  • San Francisco, CA
View GitHub Profile
@seekshreyas
seekshreyas / QtMacDeploy.txt
Created April 8, 2012 07:25 — forked from Acrowit/QtMacDeploy.sh
Qt Mac Deployment Script
# Qt Mac Deployment Script
# ---------------------------
# Generate Build By :
$ QtSDK/Desktop/Qt/474/gcc/bin/macdeployqt MyApp.app
# Verify Build By
$ otool -L MyApp.app/Contents/MacOS/MyApp
auth = OAuthHandler(CLIENT_ID, CLIENT_SECRET, CALLBACK)
auth.set_access_token(ACCESS_TOKEN)
api = API(auth)
venue = api.venues(id='4bd47eeb5631c9b69672a230')
stopwords = nltk.corpus.stopwords.words('portuguese')
tokenizer = RegexpTokenizer("[\w’]+", flags=re.UNICODE)
@seekshreyas
seekshreyas / AS-pauseGrowl.scpt
Last active August 29, 2015 14:05 — forked from deviantintegral/Growl Pause and Resume.scpt
AppleScript to pause Growl
(**
* Pause and resume Growl. Use in a launcher like Quicksilver or Alfred to
* pause and resume Growl when the menu bar icon is disabled.
*
* Author: Andrew Berry, deviantintegral@gmail.com
*)
tell application "Growl"
register as application "Growl pause/resume" all notifications {"Growl paused", "Growl resumed"} default notifications {"Growl paused", "Growl resumed"} icon of application "Growl"
if is paused then
resume
@seekshreyas
seekshreyas / python-pandas-redshift.py
Last active August 29, 2015 14:06 — forked from elliottcordo/gist:59d3c90b158331fe6ed7
Connecting python to redshift
import sys
import logging
import psycopg2
import pandas as pd
import pandas.io.sql as sqlio
import ConfigParser
import argparse
import statistics
from pandas import pivot_table, crosstab
from datetime import datetime
#List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
#Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
#Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(value_list)]
"""quick way to create a data frame to try things out"""
df = pd.DataFrame(np.random.randn(5, 4), columns=['a', 'b', 'c', 'd'])
df['A'] """ will bring out a col """ df.ix[0] """will bring out a row, #0 in this case"""
"""Given a dataframe df to filter by a series s:"""
df[df['col_name'].isin(s)]
"""to do the same filter on the index instead of arbitrary column"""
df.ix[s]

Screencapture and animated gifs

I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).

Capturing (Easy)

  1. Launch quicktime player
  2. do Screen recording

screen shot 2014-10-22 at 11 16 23 am

@seekshreyas
seekshreyas / ajaxListener.js
Created April 12, 2017 21:21 — forked from icodejs/ajaxListener.js
JS: Listen to ajax calls from Javascript
var open = window.XMLHttpRequest.prototype.open,
send = window.XMLHttpRequest.prototype.send,
onReadyStateChange;
function openReplacement(method, url, async, user, password) {
var syncMode = async !== false ? 'async' : 'sync';
console.warn(
'Preparing ' +
syncMode +
' HTTP request : ' +
@seekshreyas
seekshreyas / pmml_bayesnet.ipynb
Created August 25, 2017 20:22 — forked from rtbs-dev/pmml_bayesnet.ipynb
Bayesian Network Models in PyMC3 and NetworkX
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@seekshreyas
seekshreyas / ka_bnet_numpy.py
Created August 29, 2017 06:08 — forked from kohlmeier/ka_bnet_numpy.py
Bayes net example in Python with Khan Academy data
#!/usr/bin/env python
from numpy import asmatrix, asarray, ones, zeros, mean, sum, arange, prod, dot, loadtxt
from numpy.random import random, randint
import pickle
MISSING_VALUE = -1 # a constant I will use to denote missing integer values
def impute_hidden_node(E, I, theta, sample_hidden):