Skip to content

Instantly share code, notes, and snippets.

View kashav's full-sized avatar
🧠

Kashav Madan kashav

🧠
View GitHub Profile
@kashav
kashav / players.json
Last active January 14, 2019 22:31
List of 2016 NBA players
[
{
"name": "Alex Abrines",
"personId": 203518
},
{
"name": "Quincy Acy",
"personId": 203112
},
{
@kashav
kashav / mongo_backup.sh
Created January 9, 2017 05:19 — forked from sheharyarn/mongo_backup.sh
Mongodump Shell Script for Cronjob
#!/bin/bash
MONGO_DATABASE="your_db_name"
APP_NAME="your_app_name"
MONGO_HOST="127.0.0.1"
MONGO_PORT="27017"
TIMESTAMP=`date +%F-%H%M`
MONGODUMP_PATH="/usr/bin/mongodump"
BACKUPS_DIR="/home/username/backups/$APP_NAME"
@kashav
kashav / keybase.md
Last active February 2, 2017 14:37
Keybase verification

Keybase proof

I hereby claim:

  • I am kshvmdn on github.
  • I am kshvmdn (https://keybase.io/kshvmdn) on keybase.
  • I have a public key whose fingerprint is 19E9 0B95 3245 213F 0BD7 80BC 1A72 ED9B 7146 4368

To claim this, I am signing this object:

@kashav
kashav / killchrome
Created June 5, 2017 21:57
Kill all active Chrome tabs
#!/usr/bin/env bash
ps ux | grep '[C]hrome Helper --type=renderer' | grep -v extension-process | tr -s ' ' | cut -d ' ' -f2 | xargs kill
@kashav
kashav / kobe.txt
Created November 10, 2017 19:22
🐐
01 Make sacrifices
02 One move at a time
03 Trust your skills
04 Use your scars as a weapon
05 Focus on each day
06 Don't be afraid of confrontation
07 Be competitive when it's hard
08 Just keep going
09 Thrive on being an outsider
10 Compete with yourself

On Open Source and Impactfulness

I often find myself caught in a web of thinking to myself "I must contribute code to the open source community that benefits the community". While this is fine and well, there's another side to this story — one of my own mental health.

I have to admit that I often write code purely for my own benefit — it gives me something to do in my free time, and is quite a bit of fun. Therefore, not all code I contribute needs to be either useful or even reasonable.

There's a balance between these two worlds. If you lean too far on either side, you'll get stuck in a rut of writing no code at all, or tons of nonsense no one will ever touch.

@kashav
kashav / orhttp_example.go
Created November 11, 2017 06:58 — forked from Yawning/orhttp_example.go
How to dispatch HTTP requests via Tor in Go.
// To the extent possible under law, the Yawning Angel has waived all copyright
// and related or neighboring rights to orhttp_example, using the creative
// commons "cc0" public domain dedication. See LICENSE or
// <http://creativecommons.org/publicdomain/zero/1.0/> for full details.
package main
import (
// Things needed by the actual interface.
"golang.org/x/net/proxy"
package main
import (
"flag"
"go/parser"
"go/token"
"io/ioutil"
"log"
"github.com/davecgh/go-spew/spew"
package main
import (
"fmt"
"math"
"math/big"
"os"
"strconv"
)
FROM openjdk:8
ENV SDK_URL="https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip" \
ANDROID_HOME="/usr/local/android-sdk" \
ANDROID_VERSION=23 \
ANDROID_BUILD_TOOLS_VERSION=23.0.2
# Download Android SDK
RUN mkdir "$ANDROID_HOME" .android \
&& cd "$ANDROID_HOME" \