Skip to content

Instantly share code, notes, and snippets.

Turn on META key in Terminal.app preferences
Increase font size to 18 for Basic Terminal.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install caskroom/cask/brew-cask
brew doctor
brew update && brew upgrade
brew install git
brew install ghc cabal-install
brew install go
mkdir $HOME/Go
@eviltofu
eviltofu / main.go
Created March 2, 2017 08:16
Simple Connection Rate Limiter
package main
import (
"fmt"
"net"
"rateLimit"
"time"
)
func main() {
defmodule Work do
@spec all_face_cards?(list()) :: boolean()
def all_face_cards?(list) when is_list(list) do
list |> Enum.all?(&face_card?/1)
end
@spec face_card?(integer()) :: boolean()
def face_card?(1), do: true
def face_card?(x) when x >= 10 and x <= 13, do: true
def face_card?(_), do: false
defmodule WorkTest do
use ExUnit.Case
doctest Work
test "face_card?" do
assert Work.face_card?(1)
for card_value <- 2..9 do
refute Work.face_card?(card_value)
end

TILT: xargs and $()

Today I learned that (TILT) I can use xargs and $() to send the output of one command line app to be used as the parameters of the next.

For some reason, I needed the version of make on my macOS. A quick trip to Terminal.app and make --version spits out the required information. But wait, what was this in the corner?

This program built for i386-apple-darwin11.3.0.

So was make an intel binary? file can be used to determine the binary architecture but what was the path to make? Fiddling through the man pages showed me that whence -pa [^1] will find all copies (excluding aliases) of make in my PATH.

TILT: emacs configuration

Today I learned that (TILT) I could edit the .emacs file to start emacs with the various modes turned on.

The default emacs setup that comes with my system (macOS) lacks certain features. The mouse and mouse wheel are not used, there is no word wrap, etc. So I dug through the emacs brain dump via Google and found the following .emacs [^1] modifications:

(xterm-mouse-mode t)
(mouse-wheel-mode t)
(global-visual-line-mode t)