Skip to content

Instantly share code, notes, and snippets.

@venkat
venkat / crawl.py
Created May 30, 2014 22:15
Using gevent to crawl 100 links given a seed link, based off of http://blog.hownowstephen.com/post/50743415449/gevent-tutorial
# monkey-patch
import gevent.monkey
gevent.monkey.patch_all()
import gevent.pool
import gevent.queue
import sys
import re
import requests

Keybase proof

I hereby claim:

  • I am venkat on github.
  • I am venkat (https://keybase.io/venkat) on keybase.
  • I have a public key whose fingerprint is AA7E 9677 2E78 608F A976 A21C AEF1 5277 6F50 059C

To claim this, I am signing this object:

@venkat
venkat / index.html
Created September 25, 2016 22:50
Exported from Popcode. Click to import: https://popcode.org/?gist=eebdad91b3ea85456e88b2e9ca68283f
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<p> hello </p>
</body>
</html>
@venkat
venkat / calculate_liveability.py
Created February 15, 2017 00:18
Output per-county tab-separated information
#!/bin/env python
#data downloaded from https://data.opendatasoft.com/explore/dataset/usa-2016-presidential-election-by-county@public/download/?format=json&timezone=America/New_York
import json
def get_liveability_info(db, county_state_to_recordid_map, state_county):
record_ids = county_state_to_recordid_map[state_county]
if len(record_ids) != 1:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<h2> Enter the secret number </h2>
<input id="secret">
<button id="confirm">Confirm</button>
<p id="response"></p>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<title>My first If statment</title>
</head>
<body>
<h1></h1>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h2> We are volunteers from ______ </h2>
<p> Guess the word </p>
<input id="secret" />
<button id="confirm">Confirm </button>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<span id="badveggie"></span> is a vegetable I don't like at all!
<br/>
<br/>
<span id="goodveggie"></span> is a vegetable I love!
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<span id="badveggie"></span> is a vegetable I don't like at all!
<br/>
<br/>
<span id="goodveggie"></span> is a vegetable I love!
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<p>
The length of the array is: <span id="len"></span>
</p>