Skip to content

Instantly share code, notes, and snippets.

@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 / ssl-certs.sh
Last active June 13, 2024 12:48
Self signing certificate script
#!/bin/bash
# =============================================================================
# ssl-certs.sh - Self signing SSL certificates
#
# Author: Steve Shreeve <[email protected]>
# Date: Dec 17, 2022
# =============================================================================
# Use https://gist.github.com/shreeve/3358901a26a21d4ddee0e1342be7749d
@shreeve
shreeve / .gitconfig
Last active December 16, 2022 04:54
Git config file
# =============================================================================
# .gitconfig
#
# Author: Steve Shreeve <[email protected]>
# Date: Dec 15, 2022
# =============================================================================
# curl -Lso ~/.gitconfig http://bit.ly/3FANcK7
[user]
@shreeve
shreeve / .tmux.conf
Last active January 6, 2023 00:30
Config file for tmux
# =============================================================================
# .tmux.conf
#
# Author: Steve Shreeve <[email protected]>
# 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 / .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 / install-mac.md
Last active October 16, 2024 20:21
Install macOS
@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 / 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 / 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 / watch.coffee
Created February 9, 2018 20:54
Simple macos-only file watcher (basic concept, not done)
#!/usr/bin/env coffee
fs = require 'fs'
fp = require 'path'
EventEmitter = require 'events'
class Watcher extends EventEmitter
constructor: (globs, cb) ->
super()
@watch globs, cb if globs?.length