Skip to content

Instantly share code, notes, and snippets.

View sughodke's full-sized avatar
🧧
Building

Sid Ghodke sughodke

🧧
Building
  • San Jose, California
View GitHub Profile
@sughodke
sughodke / watcher.py
Created September 24, 2017 19:17
ActivityWatch plugin for osquery
#!/usr/bin/env python
import osquery
import requests
headers = {
'Accept': 'application/json',
}
URL = 'http://localhost:5600/api/0/' \
'buckets/aw-watcher-window_Beaker-2.local/events'
11/21/16 Hourly Breakdown of Renewable Resources (MW)
Hour GEOTHERMAL BIOMASS BIOGAS SMALL HYDRO WIND TOTAL SOLAR PV SOLAR THERMAL
1 962 218 180 254 384 0 0
2 962 215 180 217 479 0 0
3 962 215 181 208 430 0 0
4 958 214 180 229 969 0 0
5 956 218 179 288 1272 0 0
6 956 220 180 290 1395 0 0
7 956 227 181 294 1336 55 0
8 955 238 178 310 1616 1682 0
@sughodke
sughodke / ulam.py
Created April 15, 2017 07:59
Output the value of the Ulam spiral
import numpy as np
def ulam_polar(x, y, verbose=False):
"""
Solves for the value at location (x, y) in the Ulam spiral by
(1) converting to (x, y) polar coordinates (r, theta)
(2) developing a `Ulam square` for a given ring-size
(3) finding the intersection of the the Ulam square and the input vector
@sughodke
sughodke / question_clf.py
Created December 14, 2016 22:47
Determine if some text is a question
import nltk
import random
from pprint import pprint
from sklearn.pipeline import Pipeline
from sklearn.metrics import classification_report
from sklearn.feature_extraction.text import HashingVectorizer
posts = nltk.corpus.nps_chat.xml_posts([
@sughodke
sughodke / README.md
Last active April 19, 2020 20:15
Timeline of Engineering and Technology History

Using the data from IEEE ethw website to show a timeline of achievements.

@sughodke
sughodke / index.html
Last active August 29, 2015 14:00
Heatmap of Train Data
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
width: 960px;
height: 500px;
position: relative;
}
@sughodke
sughodke / index.html
Last active August 29, 2015 13:57
Olympic Medals By Country By Year (Freebase)
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
width: 960px;
height: 500px;
position: relative;
}
#!/bin/python
def myFun(ar, cols=3):
le = len(ar)
rem = le % cols
binSize = cols - rem
line = 0
i = 0