Skip to content

Instantly share code, notes, and snippets.

@j-po
j-po / scary-people.clj
Last active August 21, 2016 14:43
Go `n` levels deep into the "Normal people scare me" shirt
(defn scary-people
"Go `n` levels deep into the \"Normal people scare me\" shirt"
[n]
(loop [n n
ret "Normal people scare me"
quotes (if (odd? n) \" \')]
(if (zero? n)
ret
(recur (dec n)
(str "Normal people wearing " quotes ret quotes " shirts scare me")
@j-po
j-po / gitstack.sh
Last active August 7, 2022 09:55
`pushd` and `popd`-style commands for git branches (in the place of directories)
# `pushd` and `popd`-style commands for git branches (in the place of directories)
# USAGE: `pushb <branch>; SOME_WORK; popb`
GITSTACK=() # stack of branches–just an array that we add to and access from the tail
GITSTASHCK=() # stack of stashes
function pushb {
GITSTACK+=`git symbolic-ref --short HEAD`
GITSTASHCK+=`git stash create`
git reset --hard # `git stash create` doesn't do this the way `git stash` normally does
git checkout $1
# From Udacity's Software Testing class (problem set 3, problem 1)
#
# SPECIFICATION:
#
# check_sudoku() determines whether its argument is a valid Sudoku
# grid. It can handle grids that are completely filled in, and also
# grids that hold some empty cells where the player has not yet
# written numbers.
#
# First, your code must do some sanity checking to make sure that its