Skip to content

Instantly share code, notes, and snippets.

View justindujardin's full-sized avatar
☂️
You can do it. I believe in you.

Justin DuJardin justindujardin

☂️
You can do it. I believe in you.
View GitHub Profile
@karpathy
karpathy / gist:587454dc0146a6ae21fc
Last active May 16, 2024 19:55
An efficient, batched LSTM.
"""
This is a batched LSTM forward and backward pass
"""
import numpy as np
import code
class LSTM:
@staticmethod
def init(input_size, hidden_size, fancy_forget_bias_init = 3):
@ShirtlessKirk
ShirtlessKirk / luhn.js
Last active May 17, 2024 08:05
Luhn validation algorithm
/**
* Luhn algorithm in JavaScript: validate credit card number supplied as string of numbers
* @author ShirtlessKirk. Copyright (c) 2012.
* @license WTFPL (http://www.wtfpl.net/txt/copying)
*/
var luhnChk = (function (arr) {
return function (ccNum) {
var
len = ccNum.length,
bit = 1,