Skip to content

Instantly share code, notes, and snippets.

View 0.txt
Save this in [[roam/css]] as a toplevel block, wrapped in "```css" and "```"
@burke
burke / remotepaste.md
Last active Sep 10, 2020
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
View remotepaste.md

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>
View nix_store_safeguard.rb
# typed: false
# frozen_string_literal: true
# Note: This is loaded *ludicrously* early in the boot process: please don't
# introduce other dependencies here.
# ===
# Okay so here's the deal. When we compile a bundle of ruby code via
# `bundlerEnv`, we install all the gems individually into a bunch of separate
View apfs_volume.rb
# typed: true
# frozen_string_literal: true
require('dev')
require('fileutils')
module Dev
module Helpers
class APFSVolume
extend(T::Sig)
View ru.nix
{ 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 / 0-README.md
Last active Jun 9, 2020
Code Release for NixCon 2019
View 0-README.md

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.

View gameoflife.rb
# -*-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{[];[]}
@burke
burke / 0-readme.md
Created Jan 27, 2012 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv
View 0-readme.md

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.

View ,
#!/bin/bash
#
# usage example:
# $ , yarn --help
# This finds a derivation providing a bin/yarn, and runs it with `nix run`.
# If there are multiple candidates, the user chooses one using `fzy`.
set -euo pipefail
if [[ $# -lt 1 ]]; then
>&2 echo "usage: , <program> [arguments]"
View ohno.rb
require('yaml')
module Ohno
def self.replace_index(welp, index)
case welp
when String
welp == "$index" ? index : welp.gsub(/\$index/, index.to_s)
else
welp
end
You can’t perform that action at this time.