This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eEu -o pipefail | |
# set -x | |
WORKSPACES="project-web project-admin cider-scratchpad lambda-handler api-tests terraform project-web-tests project-admin-tests" | |
COMMANDS="urls reset gist shutdown stop workspaces commands all" | |
function workspace-name-for-abbreviation { | |
case "$1" in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eEu -o pipefail | |
# set -x | |
WORKSPACES="project-web project-admin cider-scratchpad lambda-handler api-tests terraform cypress-web cypress-admin" | |
COMMANDS="urls reset gist shutdown stop workspaces commands all" | |
function workspace-name-for-abbreviation { | |
case "$1" in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Test { | |
public static String evenOrOdd(int val) { | |
if (0 == (val % 2)) { | |
return "even"; | |
} | |
return "odd"; | |
} | |
public static String evenOrOdd(long val) { | |
if (0 == (val % 2)) { | |
return "even"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Don't cheat! | |
* | |
* javac Foo.java && java Foo | |
* | |
*/ | |
public class Foo { | |
public static void main (String [] args) { | |
System.out.println("option1\n\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set WshShell = CreateObject("WScript.Shell") | |
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId")) | |
Function ConvertToKey(Key) | |
Const KeyOffset = 52 | |
i = 28 | |
Chars = "BCDFGHJKMPQRTVWXY2346789" | |
Do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// =countbackgrounds("C2:K2","#00ff00") | |
/* | |
it's a bit of a hack to send in the cell range as a string, though it works when calling getRange: | |
SpreadsheetApp.getActiveSpreadsheet().getRange(range) | |
This also means you can't "fill down" to have the ranges updated to match your sheet, so hack number two genreates | |
the formulas so you can copy/paste them into the sheet: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(let [chars (-> | |
"01000010 01000101 01000101 01010010" | |
(.split " ") | |
vec) | |
nums (mapv #(Integer/parseInt % 2) | |
chars)] | |
(mapv #(-> % char str) nums)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Philosophical: | |
* writing lines of code is one of the least valuable things I can do | |
* cultivate your impatience | |
* reject the status quo, unless we can re-derive it from first-principles | |
* engineers imprint on the first languages (techniuqes, frameworks or technology) that we find success with (unconsciously seen as caregivers, which we defend w/o always knowing why) | |
* we tend to overvalue the familiar/known; we tend to undervalue the unfamiliar/unknown, this interferes with our receptiveness to new ideas and personal growth | |
* we're 90% composed of bad habits; many of our best habits become bad as time passes; this allows us to filter for the fundamental; the great | |
* make doing the right thing easier than any other thing, or we will fail to achieve greatness, or break bad habits | |
* be conscious, be intentional | |
* "is this the highest we can aim?" (I prefer this over "is this the best we can do", the former is aspirational, the latter is judgemental) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$meats = %w[fajita-veggie carnitas barbacoa chicken steak] | |
$rices = ['no-rice', 'white rice', 'brown rice'] | |
$salsas = ['mild salsa', 'medium salsa', 'salsa roja'] | |
$toppings = %w[sour-cream guacamole lettuce cheese] | |
def gen | |
ingredients = [] | |
base = $meats[rand($meats.size)] + ' burrito with ' | |
ingredients << $rices[rand($meats.size-1)] | |
if rand < 0.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; condition free fizz-buzz solution, based on code from [email protected] to the clojure list | |
;; uses infinite, lazy-sequences | |
(let [three (cycle [nil nil "fizz"]) | |
five (cycle [nil nil nil nil "buzz"])] | |
(defn fizz-buzz [] | |
(map vector (iterate inc 1) three five))) | |
(doseq [tuple (take 30 (fizz-buzz))] | |
(println (apply str (interpose " " (filter identity tuple))))) |
NewerOlder