Skip to content

Instantly share code, notes, and snippets.

View sameetandpotatoes's full-sized avatar
🎯
Focusing

Sameet Sapra sameetandpotatoes

🎯
Focusing
View GitHub Profile
{"4":1029,"5":84,"6":163,"7":296,"8":168,"9":435,"10":454,"11":297,"12":555,"13":952,"14":550,"15":80,"16":197,"17":1122,"18":277,"19":52,"20":11,"21":18,"22":103,"23":92,"24":9,"25":4,"26":1,"27":5,"28":8,"29":10,"30":45,"31":55,"32":271,"33":176,"34":56,"35":30,"36":78,"37":35,"38":104,"39":112,"40":44,"41":13,"42":33,"43":563,"44":695,"45":348,"46":4,"47":435,"48":536,"49":2707,"50":1339,"51":3,"53":2,"54":2,"55":30,"56":6,"57":12,"58":17,"59":28,"60":14,"61":32,"62":33,"63":32,"64":51,"65":4,"66":4}
@sameetandpotatoes
sameetandpotatoes / download_all_repos.py
Created March 18, 2018 18:34
Download all private repos
import sys
import requests
import os
from requests.auth import HTTPBasicAuth
PERSONAL_ACCESS_TOKEN = "REGISTER FROM Settings -> Access Tokens"
if len(sys.argv) != 2:
print("Usage: python {} <username:String>".format(__file__))
exit(1)
@sameetandpotatoes
sameetandpotatoes / gist:11131080
Created April 21, 2014 02:58
Lets Revolutionize Testing - JSON parsing in node.js
var http = require('http');
function follow (url) {
//Adding .json to url if its the first url
url = url.indexOf('?') !== -1 ? url.replace(/\?/,'.json?') : url + '.json';
http.get(url, function (res) {
var raw_data = "";
res.on('data', function (data) {
raw_data += data;
});
res.on('end', function (data){
@sameetandpotatoes
sameetandpotatoes / Twitter Bot
Last active August 29, 2015 14:00
Twitter Bot - Github, Reddit, 9gag
var express = require("express");
var app = express();
var port = Number(process.env.PORT || 5000);
app.listen(port, function() {
console.log("Listening on " + port);
});
var Bot = require('./bot')
, config1 = require('./config1');
@sameetandpotatoes
sameetandpotatoes / Parsing XML in Ruby
Created March 28, 2014 23:01
Parsing XML in Ruby
require 'net/http'
require 'rexml/document'
website = "http://events.uchicago.edu/feeds/uevents/?from=today&to=next+month"
xml_data = Net::HTTP.get_response(URI.parse(website)).body
doc = REXML::Document.new(xml_data)
titles = []
descriptions = []
doc.elements.each("Events/Event/title") do |title|
titles << title.text