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 / 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"
@prakhar1989
prakhar1989 / bling.js
Created June 10, 2016 13:43 — forked from paulirish/bling.js
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@prakhar1989
prakhar1989 / core.cljs
Created May 13, 2016 00:16 — forked from nasser/core.cljs
rough sketch of reactive svg rendering
(ns savage.core
(:require-macros [reagent.ratom :refer [reaction]])
(:require [reagent.core :as reagent :refer [cursor atom track track!]]
[reagent.ratom :refer [make-reaction]]
[clojure.set :as set]
[clojure.string :as string]))
(enable-console-print!)
(defn sqrt [x] (.sqrt js/Math x))

Async data loading in Flux

I've been working with Flux a lot recently, and one of the questions I've been struggling with is in which part of the Flux cycle to put my asynchronous data requests.

Here are some different opinions:

The diagram

The famous Flux diagram puts them in the action creators.

The chat example

This is a plain-text version of Bret Victor’s reading list. It was requested by hf on Hacker News.


Highly recommended things!

This is my five-star list. These are my favorite things in all the world.

A few of these works have had an extraordinary effect on my life or way of thinking. They get a sixth star. ★

@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:

  1. General Background and Overview
@prakhar1989
prakhar1989 / Remove From Git By Extension
Created March 16, 2012 23:11 — forked from benzittlau/Remove From Git By Extension
Remove all *.swp files from a git repository
git ls-files | grep '\.swp$' | xargs git rm
@prakhar1989
prakhar1989 / gist:1885267
Created February 22, 2012 14:01
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+X delete line
Ctrl+↩ insert line after
Ctrl+⇧+↩ insert line before
Ctrl+⇧+↑ move line (or selection) up