Skip to content

Instantly share code, notes, and snippets.

@shreeve
shreeve / binding_of_caller-ffi.rb
Last active March 1, 2018 14:08
binding_of_caller, pure FFI version (no compiler needed)
#!/usr/bin/env ruby
# =============================================================================
# Quick proof-of-concept of an FFI-based binding_of_caller (no compiling!)
#
# Author: Steve Shreeve <steve.shreeve@gmail.com>
# Basis: binding_of_caller and ffi gems
# Date: 28 May 2015
#
# Legal: MIT License
@shreeve
shreeve / codesandbox.md
Last active January 18, 2019 09:35
Some codesandbox stuff stuff

main.coffee

import Vue from "vue"
import App from "./App"

Vue.config.productionTip = false

new Vue
  el: "#app"
@shreeve
shreeve / ruby-precedence.txt
Created August 16, 2019 22:27
Ruby Precedence
N A M Operator(s) Description
- - - ----------- -----------
1 R Y ! ~ + boolean NOT, bitwise complement, unary plus
(unary plus may be redefined from Ruby 1.9 with +@)
2 R Y ** exponentiation
1 R Y - unary minus (redefine with -@)
2 L Y * / % multiplication, division, modulo (remainder)
2 L Y + - addition (or concatenation), subtraction
@shreeve
shreeve / waitForSelector.md
Last active November 23, 2022 08:20
Helpful waitForSelector() javascript method

waitForSelector(want, opts={})

coffeescript

waitForSelector(want, opts={}) =>
  new Promise (resolve, reject) =>
    return resolve node if node = document.querySelector want

    find = new MutationObserver (changes) =>
@shreeve
shreeve / .vimrc
Created December 11, 2022 07:48
Vim configuration file
" vim config
set nocompatible " Must come first because it changes other options
" Enable pathogen
execute pathogen#infect()
color benlight " Color theme
syntax on " Use syntax highlighting
@shreeve
shreeve / .gitconfig
Last active December 16, 2022 04:54
Git config file
# =============================================================================
# .gitconfig
#
# Author: Steve Shreeve <steve.shreeve@gmail.com>
# Date: Dec 15, 2022
# =============================================================================
# curl -Lso ~/.gitconfig http://bit.ly/3FANcK7
[user]
@shreeve
shreeve / nginx-cors.md
Last active December 19, 2022 18:58
Enable CORS in nginx

Configure nginx to handle CORS for us, so we don't even see it

  server {
    server_name _;
    listen      443 ssl http2;
    listen [::]:443 ssl http2;

    root /home/public/www;
@shreeve
shreeve / .tmux.conf
Last active January 6, 2023 00:30
Config file for tmux
# =============================================================================
# .tmux.conf
#
# Author: Steve Shreeve <steve.shreeve@gmail.com>
# Date: Jan 5, 2023
# =============================================================================
# curl -so ~/.tmux.conf https://gist.githubusercontent.com/shreeve/c751769ea46b34c1c30b97fa2762770b/raw/.tmux.conf
#
# For iTerm2, make sure to check "use Powerline Glyphs" in order to render special chars
@shreeve
shreeve / ssl-certs.sh
Last active October 16, 2023 21:41
Self signing certificate script
#!/bin/bash
# =============================================================================
# ssl-certs.sh - Self signing SSL certificates
#
# Author: Steve Shreeve <steve.shreeve@gmail.com>
# Date: Dec 17, 2022
# =============================================================================
# Use https://gist.github.com/shreeve/3358901a26a21d4ddee0e1342be7749d
@shreeve
shreeve / install-mac.md
Last active February 10, 2024 22:22
Install macOS