I hereby claim:
- I am jb on github.
- I am ht (https://keybase.io/ht) on keybase.
- I have a public key whose fingerprint is 3582 E1C0 B987 41E8 CD01 F6B9 419C A53B DF3C B6C3
To claim this, I am signing this object:
| \documentclass[a4paper]{article} | |
| \usepackage{multicol, amsmath, amsfonts, xcolor} | |
| \usepackage[landscape, margin=0.2in]{geometry} | |
| \title{15.415 Cheat Sheet} | |
| \author{Zaz Brown} | |
| \date{Dec 2021} | |
| \newcommand{\dd}{\mathrm d} |
| \documentclass[a4paper]{article} | |
| \usepackage{multicol, amsmath, amsfonts, xcolor} | |
| \usepackage[landscape, margin=0.2in]{geometry} | |
| \title{15.415 Cheat Sheet} | |
| \author{Zaz Brown} | |
| \date{Dec 2021} | |
| \newcommand{\dd}{\mathrm d} |
| (defn fizzbuzz? | |
| "Determines what to print for a given number" | |
| [x] | |
| (condp #(zero? (mod %2 %1)) x | |
| 15 "fizzbuzz" | |
| 3 "fizz" | |
| 5 "buzz" | |
| 1 x)) | |
| (defn fizzbuzz |
| # Zaz Brown | |
| # github.com/zaz/dijkstra | |
| """An efficient algorithm to find shortest paths between nodes in a graph.""" | |
| from collections import defaultdict | |
| class Digraph(object): | |
| def __init__(self, nodes=[]): | |
| self.nodes = set() | |
| self.neighbours = defaultdict(set) | |
| self.dist = {} |
I hereby claim:
To claim this, I am signing this object:
| numbers = [1,3,5,8,10,54,99] | |
| cards = [5,3,4,6,2] | |
| # get only the values where the distance is greater than 10 | |
| numbers.each_cons(2).select {|a,b| b-a>10 } #=> [[10, 54], [54, 99]] | |
| # determine if the hand is a straight | |
| cards.sort.each_cons(5).all? do |series| | |
| series.last - series.first == 4 | |
| end #=> true |
| #!/bin/bash | |
| DEV="eth0" | |
| ROUTER="192.168.0.1" | |
| MAC="${1:-01:23:45:67:89:ab}" | |
| IP="192.168.0.5/24" | |
| if [[ "${UID}" != 0 ]]; then | |
| exec sudo "$0" $@ | |
| fi |
| $(".email").each(function() { | |
| $(this).html( $(this).html().replace("...", "@").replace(/\.\.\./g, ".") ); | |
| $(this).attr("href", $(this).attr("href").replace("...", "@").replace(/\.\.\./g, ".") ); | |
| }); |
| # Check for an interactive session: | |
| [ -z "$PS1" ] && return | |
| # Bash prompt: user@HOST [ dir ] $ | |
| PS1='\[\e[1;32m\]\u@\h [ \[\e[31m\]\w\[\e[32m\] ]$(__git_ps1 " [\[\e[31m\]%s\[\e[32m\]]" 2>/dev/null) \$ \[\e[0m\]' | |
| #PS1='\[\u@\h [ \w ]$(__git_ps1 " (%s)" 2>/dev/null) \$ ' # Black & White | |
| # History file: | |
| shopt -s histappend | |
| HISTCONTROL=ignoredups:ignorespace |