Skip to content

Instantly share code, notes, and snippets.

View ankur-anand's full-sized avatar
💭
Seize The Day!

Ankur Anand ankur-anand

💭
Seize The Day!
View GitHub Profile
@tianchu
tianchu / django_auth.js
Last active June 1, 2023 21:44
How to authenticate Django users in node.js
/*
* Authenticate Django users in node.js.
*
* Django is great for many projects, while node.js does some fantastic
* jobs that Django couldn't. For example, you may have a Django app
* managing your user accounts and another real-time service or application
* running on Node, then you probably will need to read Django user session
* to authenticate users in the Node project.
*
* This gist is not production ready yet, but it demonstrates how could it
@robwierzbowski
robwierzbowski / gitcreate.sh
Last active December 27, 2024 11:23
A simple litte script. Create and push to a new github repo from the command line.
#!/bin/bash
# https://gist.github.com/robwierzbowski/5430952/
# Create and push to a new github repo from the command line.
# Grabs sensible defaults from the containing folder and `.gitconfig`.
# Refinements welcome.
# Gather constant vars
CURRENTDIR=${PWD##*/}
GITHUBUSER=$(git config github.user)
@textbook
textbook / ProblemSet3.py
Created November 1, 2012 13:16
MIT 6.00x - PSet 3 answers by jonrsharpe
import string
# 1. Polynomials
def evaluatePoly(poly, x):
return float(sum(b * (x ** a) for a,b in enumerate(poly)))
# 2. Derivatives
def computeDeriv(poly):
return [float (a * b) for a, b in enumerate(poly)][1:] or [0.0]
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs