Skip to content

Instantly share code, notes, and snippets.


Harish Karumuthil harish2704

View GitHub Profile
karpathy /
Last active June 4, 2023 00:32
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
timvisee /
Last active June 2, 2023 18:27
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.


  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
willurd /
Last active June 2, 2023 05:18
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
View gist:2999707
<!doctype html>
<title>Site Maintenance</title>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
csswizardry /
Last active May 13, 2023 10:43
Vim without NERD tree or CtrlP

Vim without NERD tree or CtrlP

I used to use NERD tree for quite a while, then switched to CtrlP for something a little more lightweight. My setup now includes zero file browser or tree view, and instead uses native Vim fuzzy search and auto-directory switching.

Fuzzy Search

There is a super sweet feature in Vim whereby you can fuzzy find your files using **/*, e.g.:

:vs **/*<partial file name><Tab>
TooTallNate / repl-client.js
Created March 26, 2012 20:09
Running a "full-featured" REPL using a net.Server and net.Socket
View repl-client.js
var net = require('net')
var sock = net.connect(1337)
sock.on('connect', function () {
rmehner / delete-databases.js
Last active April 2, 2023 16:31
Delete all indexedDB databases
View delete-databases.js
// Credit to @steobrien from
// for modern browsers, this works:
const dbs = await window.indexedDB.databases()
dbs.forEach(db => { window.indexedDB.deleteDatabase( })
// for older browsers, have a look at previous revisions of this gist.
sindresorhus / post-merge
Last active March 13, 2023 11:13
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
View post-merge
#!/usr/bin/env bash
# MIT © Sindre Sorhus -
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
mizzy / node-simple-proxy.js
Created November 6, 2011 09:07
Simple proxy made by node.js
View node-simple-proxy.js
var http = require('http');
var url = require('url');
var proxy = http.createServer(function(req, res) {
var request = url.parse(req.url);
options = {
host: request.hostname,
port: request.port || 80,
path: request.path,
method: req.method,