Skip to content

Instantly share code, notes, and snippets.

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

Shreyas seekshreyas

🐼
\_(*|*)_/
  • DocuSign
  • San Francisco, CA
  • 19:19 (UTC -08:00)
View GitHub Profile
@seekshreyas
seekshreyas / StripTags
Created November 10, 2013 11:40
Strip HTML tags from a string in Python
# reference: http://stackoverflow.com/questions/753052/strip-html-from-strings-in-python
# To strip html tags
class MLStripper(HTMLParser):
def __init__(self):
self.reset()
self.fed = []
def handle_data(self, d):
self.fed.append(d)
def get_data(self):
return ''.join(self.fed)
@seekshreyas
seekshreyas / SmokerShame
Created October 16, 2013 01:07
Smoker Shame
/* Theremin
* --------
*
*
* Created 24 October 2006
* copyleft 2006 Tod E. Kurt <[email protected]
* http://todbot.com/
*/
int potPin = 0; // select the input pin for the potentiometer
@seekshreyas
seekshreyas / lab2_shreyas_serial_pwm
Created September 25, 2013 04:34
# TUI Lab 2: Pulse Wave Modulation and Serial Input
/*
* Code for cross fading 3 LEDs and then taking user input
* to increase the stepwise intensity of the corresponding LED
* r for red, b for blue, g for gree
* by: [email protected]
* License: MIT
*/
// Output
@seekshreyas
seekshreyas / fonts.css
Created September 20, 2013 01:32
Embedding fonts I (almost) always use Open Sans font
/*fonts*/
@font-face{
font-family: 'OpenSans Regular';
src: url('../resources/fonts/opensans/opensans_regular.ttf') format('truetype');
}
@font-face{
font-family: 'OpenSans Bold';
src: url('../resources/fonts/opensans/opensans_bold.ttf') format('truetype');
}
@font-face{
@seekshreyas
seekshreyas / .gitignore
Last active December 21, 2015 05:48
Vagrant file for virtual cluster on mac courtesy: David Greco <http://www.eligotech.com/wp-content/uploads/2013/04/Vagrantfile.txt>
.vagrant
@seekshreyas
seekshreyas / DockSpacer
Last active December 21, 2015 01:48
# DockSpacer _Add spaces in your Dock_
# Add a spacer to the left side of the Dock (where the applications are)
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
# Add a spacer to the right side of the Dock (where the Trash is)
defaults write com.apple.dock persistent-others -array-add '{tile-data={}; tile-type="spacer-tile";}'
killall Dock
@seekshreyas
seekshreyas / PyScaffold.py
Last active December 19, 2015 11:19
Scaffolding for my Python programs
#! /usr/bin/python
""" Program Aim
More description about the program
"""
__author__ = "@Name"
__email__ = "@Email"
__python_version = "Python 2.7.3 -- EPD 7.3-2 (32-bit)"
@seekshreyas
seekshreyas / printAttributes.py
Created July 3, 2013 21:29
For debugging in python: Print attributes of an object in python
def print_attributes(obj):
for attr in obj.__dict__:
print attr, getattr(obj, attr)
@seekshreyas
seekshreyas / index.html
Created May 16, 2013 07:09
A CodePen by Shreyas R.
<div class="timer">
<div class="timer">
<div class="timer">
<div class="timer">
<div class="timer">
</div>
</div>
</div>
</div>
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)