Skip to content

Instantly share code, notes, and snippets.

View prakhar1989's full-sized avatar
I may be slow to respond.

Prakhar Srivastav prakhar1989

I may be slow to respond.
View GitHub Profile
@prakhar1989
prakhar1989 / richhickey.md
Last active November 8, 2023 17:19 — forked from stijlist/gist:bb932fb93e22fe6260b2
richhickey.md

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

@prakhar1989
prakhar1989 / tunings.md
Created May 5, 2023 00:11
Ola Englund - The Chug Project - Tunings

B Tuning (7 String)

  • Please respong
  • Sweet baby zacharino
  • Heavy Bones
  • Beanbag Boredom

Drop C

  • Discord Shore
@prakhar1989
prakhar1989 / attendance.py
Created January 6, 2019 15:19
attendance
#!/Users/prsrivastav/miniconda3/bin/python3.7
import csv
from dataclasses import dataclass
from datetime import datetime
from typing import List
DATE_FORMAT = "%d-%m-%Y"
@prakhar1989
prakhar1989 / java.md
Last active April 18, 2018 16:50
Java Reading Notes

Java Lambdas and Closures

Chapter 1 - Intro

Google Guava Implementation of cloneWithoutNulls(List)

public static <A> List<A> cloneWithoutNulls(final List<A> list) {
 Collection<a> nonNulls = Collections2.filter(list, Predicates.notNull());</a>

Here's the prime sieve of eratosthenes implemented in 4 different functional languages.

Which one's your favorite?

OCaml
let rec range s e = if s > e then [] else s :: range (s + 1) e;;

let countprimes n =
  let rec aux count = function
❯ npm run test
> react-tag-input@4.8.2 test /Users/prsrivastav/Code/react-tags
> jest --notify --coverage
FAIL test/suggestions.test.js
● Test suite failed to run
TypeError: Cannot read property 'ReactCurrentOwner' of undefined
@prakhar1989
prakhar1989 / uscis.js
Created December 16, 2016 21:53
OPT status check
/**
* npm install superagent cheerio
* node index.js <your_case_number>
*/
const request = require('superagent');
const cheerio = require('cheerio');
const URL = "https://egov.uscis.gov/casestatus/mycasestatus.do";
const receipt = process.argv[2];
@prakhar1989
prakhar1989 / logger.py
Created December 8, 2013 14:43
Sending emails with files as attachments in python 2.4
#!/usr/bin/python
import MySQLdb as mdb
import sys
import csv
import smtplib
from datetime import datetime
from email.MIMEBase import MIMEBase
from email.MIMEMultipart import MIMEMultipart
from email import Encoders
@prakhar1989
prakhar1989 / game.py
Created August 30, 2014 19:01
Game
import random
if __name__ == "__main__":
# this decides whether the user wants to continue
choice = True
# the main game loop
while choice:
print "Random number: " + str(random.random() * 100)
print "Do you want to continue? Y/N?: ",
user_choice = raw_input()
@prakhar1989
prakhar1989 / replify
Created August 19, 2016 20:17 — forked from danielrw7/ replify
replify - Create a REPL for any command
#!/bin/sh
command="${*}"
printf "Initialized REPL for [%s]\n" "$command"
printf "%s> " "$command"
read -r input
while [ "$input" != "" ];
do
eval "$command $input"
printf "\n%s> " "$command"