Skip to content

Instantly share code, notes, and snippets.

@beefan
beefan / rem-widget-scriptable.js
Created November 26, 2020 04:37
REM Sleep Helper Widget
// SleepyTime
// when to set your alarm if you go to bed now
// wake up in between REM cycles to feel rested
//
const REM_CYCLE_LENGTH = 90
let widget = new ListWidget()
buildWidget()
// for debugging, allows script to run in app
@jaredpalmer
jaredpalmer / tweet.js
Created April 6, 2016 22:45
send-tweet.js
/*
* Code snippet for posting tweets to your own twitter account from node.js.
* You must first create an app through twitter, grab the apps key/secret,
* and generate your access token/secret (should be same page that you get the
* app key/secret).
* Uses oauth package found below:
* https://github.com/ciaranj/node-oauth
* npm install oauth
* For additional usage beyond status updates, refer to twitter api
* https://dev.twitter.com/docs/api/1.1
@karpathy
karpathy / min-char-rnn.py
Last active June 1, 2025 13:35
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)