Skip to content

Instantly share code, notes, and snippets.

View benley's full-sized avatar
🐈

Benjamin Staffin benley

🐈
View GitHub Profile
@AlexeyRaga
AlexeyRaga / tasks.json
Last active April 2, 2017 21:32
Haskell Stack + HSpec tasks for VSCode
{
"version": "0.1.0",
"command": "stack",
"suppressTaskName": true,
"isShellCommand": true,
"args": [],
"tasks": [
{
"taskName": "build",
"args": ["build"],
#!/bin/bash
# Fetch Bazel installer and install it.
BUILD_BASE=${PWD}/build
if [ ! -d $BUILD_BASE ]
then
mkdir -p $BUILD_BASE
BAZEL_VERSION=0.1.5
INSTALLER_PLATFORM=linux-x86_64
@vasanthk
vasanthk / System Design.md
Last active November 15, 2025 18:07
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@rf-
rf- / nvim-client
Last active December 9, 2024 06:07
#!/usr/bin/env python
import pynvim, os, re, sys, time
# Get a list of buffers that haven't been deleted. `nvim.buffers` includes
# buffers that have had `:bdelete` called on them and aren't in the buffer
# list, so we have to filter those out.
def get_listed_buffers(nvim):
return set(buf.number for buf in nvim.buffers \
if nvim.eval('buflisted(%d)' % buf.number))
@Glench
Glench / autocomplete.js
Last active August 29, 2015 14:18
allows you to change google's autocomplete to whatever you want >:) type into google to create an autocomplete list, then activate this bookmarklet
javascript:(function()%7Bfunction%20callback()%7B(function(%24)%7Bvar%20jQuery%3D%24%3Bfunction%20omgwtfval(term)%20%7Breturn%20'%3Cli%20class%3D%22sbsb_c%20gsfs%22%20dir%3D%22ltr%22%20style%3D%22text-align%3A%20left%3B%22%3E%20%3Cdiv%20role%3D%22option%22%3E%20%3Cdiv%20class%3D%22sbqs_c%22%3E'%20%2B%20term%20%2B%20'%3C%2Fdiv%3E%20%3C%2Fdiv%3E%20%3C%2Fli%3E'%3B%7D%3Bfunction%20omgwtf(val)%20%7B%24('ul.sbsb_b%20li').remove()%3Bvar%20terms%20%3D%20val.split('%5Cn')%3Bterms.forEach(function(term)%20%7B%24('ul.sbsb_b').append(omgwtfval(term))%3B%7D)%3B%7D%3B%24('body').prepend(%24('textarea').attr('id'%2C%20'omgwtf').css(%7Bposition%3A%20'absolute'%2C%20right%3A%2020%2C%20top%3A%2020%2C%20width%3A%20300%2C%20height%3A%20400%2C%20zIndex%3A%201000000%2C%20display%3A%20'block'%7D))%3B%24('%23omgwtf').on('input%20propertychange'%2C%20function()%20%7Bomgwtf(this.value)%3B%24('.mw%2C%20%23footcnt%2C%20%23main').remove()%3B%7D)%7D)(jQuery.noConflict(true))%7Dvar%20s%3Ddocument.createElement(%22script%22)%3Bs.src%3D%22ht
@kevints
kevints / backup_repl.py
Created March 27, 2015 21:02
Aurora Backup REPL
"""A REPL for performing ad-hoc analysis of Aurora storage backups."""
import code
from twitter.common import app
from gen.apache.aurora.storage.ttypes import Snapshot, TBinaryProtocol
from thrift.transport import TTransport
@puffnfresh
puffnfresh / chromebook-nix.sh
Last active October 28, 2020 03:06
Installation script for Nix on ChromeOS
#!/bin/sh
sudo mount -o remount,exec /tmp
if [ -x /usr/local/nixstrap/proot-x86_64 ] && [ -h ~/.nix-profile ]; then
echo "Launching shell with nix-* tools!"
exec /usr/local/nixstrap/proot-x86_64 -b /usr/local/nixstrap/nix-1.8-x86_64-linux:/nix bash --init-file ~/.nix-profile/etc/profile.d/nix.sh
fi
set -e
@rasputnik
rasputnik / gist:98aac2f8230a26f06e64
Created September 23, 2014 15:23
find marathon master using zk CLI tool
Although marathon nodes proxy to the master, that will only happen if they're alive to proxy :)
We've worked around this by using https://github.com/mmcgrana/zk to find the current marathon master from zookeeper and make the request to that. Something like:
export ZOOKEEPER_SERVERS=zk://.......
export MARATHON_ZNODE=/marathon
export LEADER=$MARATHON_ZNODE/leader
# find marathon master (each active master shows here, just grab the last)
@pascalpoitras
pascalpoitras / 1.md
Last active August 17, 2025 13:22
My WeeChat configuration

This configuration is not maintained anymore. You should think twice before using it, Breaking change and security issue will likely eventually happens as any abandonned project.