Skip to content

Instantly share code, notes, and snippets.

@jargnar
jargnar / .vimrc
Created July 15, 2018 09:51
vimrc
" Suhas vimrc
" MIT License
" Copyright 2018, <jargnar@gmail.com>
"----------------------------------------
" System: plugin manager
"----------------------------------------
call plug#begin('~/.vim/plugged')
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
@jargnar
jargnar / lightitup.ino
Last active May 6, 2018 13:01
Light it up - use photo resistor to light LED automatically in darkness
#define LED 8
#define PHOTORESISTOR A0
#define THRESHOLD 200
void setup()
{
Serial.begin(9600);
pinMode(LED, OUTPUT);
pinMode(PHOTORESISTOR, INPUT_PULLUP);
Serial.println("Hello, Arduino");
@jargnar
jargnar / hello.ino
Last active May 6, 2018 12:18
Hello Arduino
#define BUTTON 5
#define LED 8
void setup()
{
Serial.begin(9600);
pinMode(LED, OUTPUT);
pinMode(BUTTON, INPUT_PULLUP);
Serial.println("Hello, Arduino");
}
@jargnar
jargnar / asciiart.scala
Last active December 11, 2017 11:00
ASCII Art from Codingame
/*
MIT License
Copyright 2017 Suhas SG <jargnar@gmail.com>
*/
import scala.util._
object Solution extends App {
val l = readInt
val h = readInt
@jargnar
jargnar / style.mss
Last active May 4, 2017 03:35
Example carto css
Map {
background-color: #444;
}
#countries {
::outline {
line-color: #aaa;
line-width: 1;
line-join: round;
}
@jargnar
jargnar / BinaryTreeMinDepth.java
Last active March 21, 2017 11:27
Minimum Depth of a Binary Tree
/**
* Created by suhas on 21/03/17.
*/
class BinaryTree<T> {
class Node<T> {
T val;
BinaryTree left;
BinaryTree right;
Node(T val, BinaryTree left, BinaryTree right) {

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@jargnar
jargnar / webpack.config.js
Created October 23, 2016 10:32
Sample webpack config
var HtmlWebpackPlugin = require('html-webpack-plugin');
var HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
template: __dirname + '/app/index.html',
filename: 'index.html',
inject: 'body'
});
var CopyWebpackPlugin = require('copy-webpack-plugin');
var CopyWebpackPluginConfig = new CopyWebpackPlugin([
{
@jargnar
jargnar / get_state_for_district.py
Created July 16, 2016 16:12
Querying a district_code to state_code lookup service
import json
import requests
def get_state_for_district(district_code):
'''
Queries a hypothetical URL endpoint of the following form:
/lookup?level=district&parent=state&district=<district_code>
and retrieves a state_code for the given district_code
'''
@jargnar
jargnar / topo.html
Created June 4, 2016 08:25
Custom TopoJSON and Leaflet.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Custom map</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" />
</head>
<body>
<div id="map" style="width: 100%; height: 400px; margin-bottom: 1.5em;"></div>