Skip to content

Instantly share code, notes, and snippets.


Viraj Sinha vsinha

View GitHub Profile
vsinha / main.cpp
Created Sep 23, 2016
esp8266 arduino wifi
View main.cpp
#include <ESP8266WiFi.h>
const char* ssid = "************";
const char* password = "****************";
WiFiServer server(80);
void setup()
def searchForStraight(self, cards, length):
expected = cards[0].rank # initialize to first card
counter = 0 # keep track of length of# the current straight
for card in cards:
#print('rank: ', card.rank, ', expect: ', expected)
if card.rank == expected: # we are inside a "straight",
# potentially of length 1
counter += 1
elif card.rank == expected-1: # if this is another of the card we just saw
View gist:babfaf571924b4ae5ac9
### Keybase proof
I hereby claim:
* I am vsinha on github.
* I am vsinha ( on keybase.
* I have a public key whose fingerprint is 1F74 0BBE 8863 B0AA 1742 BBA5 3D92 77B3 53E7 8BE6
To claim this, I am signing this object:
vsinha / plot.html
Created Aug 8, 2014
dygraphs plot tool for stock data (stored as csvs in data/ folder relative to wherever this file is). Run "python -m SimpleHTTPServer" in the folder this file is in
View plot.html
<script type="text/javascript" src="dygraph-combined.js"></script>
.graph {
height: 250px;
import operator
# create a dict
d = dict()
d[0] = 10
d[1] = 20
d[2] = 20
# find the max value
maxValue = max(d)
You can’t perform that action at this time.