Skip to content

Instantly share code, notes, and snippets.

@gparuthi
gparuthi / example.ts
Created May 31, 2020 23:08
Extend lit-element to support state
import { customElement, property, LitElement, html, css } from 'lit-element';
import { Machine, interpret, assign, createMachine, Interpreter, StateMachine } from 'xstate';
import { XstateLitElement } from './xstate-lit-element';
interface CounterContext {
count: number;
}
type CounterEvent =
| {type: "INC"}
@gparuthi
gparuthi / Air pollution | PM2.5
Created November 11, 2017 11:27
Quick InfoVis. When is the best time to visit delhi. According to Air Pollution.
Incomplete analysis of the pollution. Source: http://www.cpcb.gov.in/CAAQM/frmReportdisplay.aspx
https://docs.google.com/spreadsheets/d/1Deabs41hrbRsGL3qiE-evNWr4LFlDwl04nhk5S485T8/edit?usp=sharing
@gparuthi
gparuthi / Air Pressure Variance In Cities
Last active June 23, 2017 22:43
Air pressure analysis in python
# Introduction
This analysis helps in comparing cities on air pressure variations.
I calculate the mean variation in air-pressure for a given city using the wunderground data.
# Overall yearly variance output:
- BOS 0.08
- JFK 0.24
- SFO 0.13
@gparuthi
gparuthi / BLE_Potentiometer_Chat.ino
Last active December 13, 2016 01:15
BLE_SimpleChat example for Readbear BLE NANO adapted to send potentiometer.
#include <BLE_API.h>
#define DEVICE_NAME "PotentiometerToChat"
#define TXRX_BUF_LEN 20
#define DEVICE_ID 0xFF
BLE ble;
@gparuthi
gparuthi / BLE_Potentiometer_Chat.ino
Created December 13, 2016 01:07
BLE_SimpleChat example for Readbear BLE NANO adapted to send potentiometer.
#include <BLE_API.h>
#define DEVICE_NAME "PotentiometerToChat"
#define TXRX_BUF_LEN 20
#define DEVICE_ID 0xFF
BLE ble;
@gparuthi
gparuthi / misfit_ios_url_schema
Created October 13, 2015 03:13
Misfit app URL Schema
shine:// URL
import requests
import datetime
from dateutil import parser
import pandas as pd
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
# plt.style.use('ggplot')
from bs4 import BeautifulSoup
import StringIO
@gparuthi
gparuthi / autossh.md
Last active August 29, 2015 14:06
AutoSSH

Userful while using local ipython notebooks or local code while accessing secure remote servers like redis, mongodb, etc.

autossh -M0 -fN -l -i ~/.ssh/id_rsa -L :localhost:

@gparuthi
gparuthi / cute names dogs
Created September 16, 2014 20:42
source yahoo answers
ABBY
AFFINITY
AKIRA
ALCHEMY
AMBER
AMBROSIA
AMETHYST
AMORE
ANAIS
ANASTASIA
@gparuthi
gparuthi / Non linear code blocks
Created September 16, 2014 17:31
Ipython notebook ideas
Today, I was imagining Ipython notebooks in a different way.
I was thinking about a non linear way of writing code. The current linear way means we write a code cell and then execute and then write another. If I would like to connect the output of one cell to another, I have to do it manually or create a function.
I wish we could set a cell of code as a code block, that can be easily be found by other notebooks.
So I dont have to copy paste the cell or create a module for the cell.
I wonder if we could also share code cell in an online repository. One starting point would be to make cells out of stackoverflow code blocks.
Stackoverflow search and import inside the notebooks! Thats a good idea.