Skip to content

Instantly share code, notes, and snippets.

View drusepth's full-sized avatar
💭
hacking away on notebook.ai

Andrew Brown drusepth

💭
hacking away on notebook.ai
View GitHub Profile
@kinoc
kinoc / jserv.py
Last active August 9, 2023 03:05
Simplest FastAPI endpoint for EleutherAI GPT-J-6B
# Near Simplest Language model API, with room to expand!
# runs GPT-J-6B on 3090 and TITAN and servers it using FastAPI
# change "seq" (which is the context size) to adjust footprint
#
# seq vram usage
# 512 14.7G
# 900 15.3G
# uses FastAPI, so install that
# https://fastapi.tiangolo.com/tutorial/
@mrmartineau
mrmartineau / stimulus.md
Last active April 19, 2024 09:41
Stimulus cheatsheet
import code
code.interact(local=dict(globals(), **locals()))
require 'google-search'
require 'thread'
require 'nokogiri'
require 'open-uri'
CASCADE_SNIPPETS = false
def method_missing method_name, *args, &block
result_queue = Queue.new
@hraban
hraban / pre-commit.md
Last active April 18, 2024 06:46
Prevent accidentally committing debug code in Git
@cflee
cflee / ruby-blocks-procs-lambdas.md
Created January 14, 2015 07:10
Discoveries about Ruby Blocks, Procs and Lambdas

Ruby: Blocks, Procs, Lambdas

Note that for blocks, {} and do ... end are interchangeable. For brevity, only the former will be listed here.

Version differences

Pre-1.9, lambda and proc are synonyms. Essentially the difference is between proc and block.

def method(&block) p block.class; p block.inspect; end
l = lambda { 5 }
@natw
natw / fizzbuzz.py
Created November 15, 2012 16:22
best fizzbuzz
import random
for i in range(0, 100):
if not i % 15:
random.seed(1178741599)
print [i+1, "Fizz", "Buzz", "FizzBuzz"][random.randint(0,3)]