Skip to content

Instantly share code, notes, and snippets.

@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

# -*-coding: utf-8-*-
module Enumerable def ‰&b;each &b;end end
∲,☃,☣,☺,✄,❤,⚠,❣=10,{},->*♧{☃[♧]=1},->*♒{☃[♒]},->*✍{☒=❤[*✍]
☺[*✍]?☒&2>☒&12:☒==3},->⚓,♫{✉=0;⚠[->¢,♎{¢|♎==0||☺[¢+⚓,♎+♫]&&✉+=1}];✉},
->➨{(-1..1).‰{|¢|(-1..1).‰{|♎|➨[¢,♎]}}},->{∲.downto(-∲).‰{|☒|(-∲..∲).‰{|☐|
$><<(☺[☐,☒]??X:?.)};puts}};☀=->{☃=({}.tap{|త|☃.‰{|(☐,☒),_|⚠[->¢,♎{
¢|♎==0||త[[☐+¢,☒+♎]]=✄[☐+¢,☒+♎]}]}})};☣[0,0];☣[1,0];☣[2,0];☣[2,1];☣[1,2]
loop{❣[];☀[]}
{ config, pkgs, lib, ... }:
{
rune.project.name = "shopify-pay";
rune.framework.rails.enable = true;
aspect.packages.include = with pkgs; [
geolite2 ngrok mysqlClient57 overmind watchman toxiproxy v8
];
rune.project.repoName = "pay";
@burke
burke / remotepaste.md
Last active September 26, 2023 11:04
This sets up keybindings in tmux that allow you to copy/paste to/from your OS X clipboard from tmux running inside an SSH connection to a remote host. Partially borrowed from http://seancoates.com/blogs/remote-pbcopy

Local (OS X) Side

~/Library/LaunchAgents/pbcopy.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
     <key>Label</key>
     <string>localhost.pbcopy</string>
@burke
burke / 0-readme.md
Last active September 4, 2023 01:53
  • grammar_hack.py is completely new;
  • all the other files are minimally modified, with additions marked by #####.
  • Bring your own grammar.ebnf.
  • The LRU cache is very sketchy, but prevented having to plumb through a correct lifetime.
  • Not sure what happens if it gets backed into a corner where there's no valid next state for the state machine.
#!/usr/bin/env python
import sys
import fire
from itertools import cycle
from transformers import AutoTokenizer
def cycle_colors(tokenizer_name):
text = sys.stdin.read()
tokenizer = AutoTokenizer.from_pretrained(tokenizer_name)
@burke
burke / ctok
Last active June 28, 2023 21:40
#!/usr/bin/env python
import sys
import fire
from itertools import cycle
from transformers import AutoTokenizer
def cycle_colors(tokenizer_name):
text = sys.stdin.read()
tokenizer = AutoTokenizer.from_pretrained(tokenizer_name)
#!ruby --disable-gems
require 'open3'
def find_git_root(curr = Dir.pwd)
abort('no git repository') if curr == '/'
return(curr) if File.exist?(File.join(curr, '.git'))
find_git_root(File.expand_path('..', curr))
end
@burke
burke / 0-README.md
Last active May 1, 2023 14:14
Code Release for NixCon 2019

The rest of these files are the code referenced in my NixCon 2019 talk which live in Shopify's non-public codebases. Everything in this gist is extracted with minimal or no change from our codebase, and thus some of it references libraries or other code not included here. cli-ui and cli-kit probably comprise a majority of these cases.

All code Copyright Shopify, 2019, released here under MIT License.

OBJS := lol.o b64.o
lol: $(OBJS)
cc -o $@ $(OBJS)
%.o: %.c
cc -c $< -o $@