Skip to content

Instantly share code, notes, and snippets.

View rpalo's full-sized avatar

Ryan Palo rpalo

View GitHub Profile
@rpalo
rpalo / walle.fish
Created June 23, 2018 18:01
Print a colored Wall-E in your terminal!
function walle
set light_blue C7E2E8
set gray C1C1BD
set light_gray EEE
set dark_gray 565653
set bronze C6973F
set yellow FFE500
set lime C6E80B
set brown 8C5D05
@rpalo
rpalo / an-old-hope.itermcolors
Created October 6, 2017 00:37
Colors file for iTerm2 that emulates the "An Old Hope" Star Wars Theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.19999992847442627</real>
@rpalo
rpalo / example.yaml
Created September 25, 2019 21:01
A simplified YAML parser to see if I could do it. Also to use in a static site generator fun project. Basically a minimal viable script. Could be more fancy.
a: b
c: "d"
e: 45
f: 156.23
g: -1
h: -0.25
i:
k: l
m: n
o:
closest_indices = np.argmin(distance, axis=1)
predictions = training_labels[closest_indices]
distance = np.sqrt(np.sum((testing - training)**2, axis=1))
testing = testing.reshape((75, 4, 1))
# This is equivalent to doing:
testing = np.expand_dims(testing, axis=2)
# Or even:
testing = testing[:, :, np.newaxis]
training = training.reshape((75, 4, 1)) # Add the third axis
training = np.swapaxes(training, 0, 2) # ROTATE!
distances = np.sqrt((testing - training)**2)
training = np.swapaxes(training, 0, 1)