Skip to content

Instantly share code, notes, and snippets.

View srm's full-sized avatar

Sam McLaughlin srm

View GitHub Profile
@JosephPecoraro
JosephPecoraro / shell-execution.rb
Last active March 19, 2025 06:46
Shell Execution in Ruby
# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Synchronous (blocking)
# Returns the output of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111
@timm
timm / for.lisp
Created February 25, 2012 04:01
LUA for loops (in LISP)
#|
The LUA programming language supports iterators.
The LUA for loop takes some generate function and asks it to
produce a function that can return the next item.
A loop is then entered. The next item is generated. If it
is non-nil, then the body of the loop is called to consume
that item.
@mrflip
mrflip / maximum_battery_life.md
Created March 19, 2012 08:32
maximum battery life checklist -- use before a long plane flight

Max Battery Life Checklist

Here is a checklist to follow if you want maximum battery life -- for instance if you're about to get on a long plane flight.

10 hour battery life on a non-SSD Macbook Pro 17"

Low power use checklist

With power connected:

@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@vicnorton
vicnorton / fltk_install_error
Created April 15, 2012 17:49
fltk install problem
Desktop$ brew install -v fltk
Warning: Formula will not build with Clang, trying LLVM
==> Downloading http://ftp2.easysw.com/pub/fltk/1.3.0/fltk-1.3.0-source.tar.gz
/usr/bin/curl -qf#LA Homebrew 0.9 (Ruby 1.8.7-249; Mac OS X 10.7.3) http://ftp2.easysw.com/pub/fltk/1.3.0/fltk-1.3.0-source.tar.gz -o /Library/Caches/Homebrew/fltk-1.3.0.tar.gz
curl: (22) The requested URL returned error: 404
Error: Download failed: http://ftp2.easysw.com/pub/fltk/1.3.0/fltk-1.3.0-source.tar.gz
anonymous
anonymous / index.html
Created August 17, 2012 06:35
This is just an experiment! There are certainly better ways to show an image of a MacBook, but none as fun as this :)
<i class="macbook"></i>
@boneskull
boneskull / gist:6011707
Created July 16, 2013 19:13
Example of service inheritance
var myApp = angular.module('myApp', []);
var baseService = function () {
this._state = {};
};
baseService.prototype.getState = function () {
return this._state;
};
baseService.prototype.setState = function (state) {
this._state = state;
@lavalamp
lavalamp / The Three Go Landmines.markdown
Last active February 28, 2025 12:54
Golang landmines

There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.

All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.

  1. Loop variables are scoped outside the loop.

What do these lines do? Make predictions and then scroll down.

func print(pi *int) { fmt.Println(*pi) }
anonymous
anonymous / config.json
Created March 9, 2015 19:50
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "#479FCA",
"@brand-success": "#8fc754",
@jdmaturen
jdmaturen / company-ownership.md
Last active July 29, 2023 22:39
Who pays when startup employees keep their equity?

Who pays when startup employees keep their equity?

JD Maturen, 2016/07/05, San Francisco, CA

As has been much discussed, stock options as used today are not a practical or reliable way of compensating employees of fast growing startups. With an often high strike price, a large tax burden on execution due to AMT, and a 90 day execution window after leaving the company many share options are left unexecuted.

There have been a variety of proposed modifications to how equity is distributed to address these issues for individual employees. However, there hasn't been much discussion of how these modifications will change overall ownership dynamics of startups. In this post we'll dive into the situation as it stands today where there is very near 100% equity loss when employees leave companies pre-exit and then we'll look at what would happen if there were instead a 0% loss rate.

What we'll see is that employees gain nearly 3-fold, while both founders and investors – particularly early investors – get dilute