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
curl -o aws-iam-authenticator https://amazon-eks.s3-us-west-2.amazonaws.com/1.10.3/2018-07-26/bin/darwin/amd64/aws-iam-authenticator | |
curl -o aws-iam-authenticator.sha256 https://amazon-eks.s3-us-west-2.amazonaws.com/1.10.3/2018-07-26/bin/darwin/amd64/aws-iam-authenticator.sha256 | |
openssl sha -sha256 aws-iam-authenticator | |
cat aws-iam-authenticator.sha256 | |
chmod +x ./aws-iam-authenticator | |
cp ./aws-iam-authenticator $HOME/bin/aws-iam-authenticator && export PATH=$HOME/bin:$PATH | |
ln -s $HOME/bin/aws-iam-authenticator $HOME/bin/heptio-authenticator-aws |
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
class PathFinder | |
def initialize(maze, start_pos=nil, end_pos=nil) | |
@maze = maze # NxN, [row][col] | |
@visited_pos = {} # pos => entry_pos | |
@start_pos = (start_pos || [0,0]) | |
@end_pos = (end_pos || [@maze.length - 1 , @maze[0].length - 1]) | |
end | |
def find_path |
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
class HMap | |
attr_accessor :values | |
@values | |
def initialize | |
@values = {} | |
end | |
def set(args) |
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 ruby | |
if __FILE__ == $PROGRAM_NAME | |
hw_weights = [ 40.0, 50.0, 40.0, 36.0, 37.0, 38.0 ] | |
hw_scores = [] | |
hw_scores = hw_weights.each_with_index.collect do |max, i| | |
print "Enter hw #{i+1} score: " | |
(gets.to_f / max) * 20 |
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
#!/bin/bash | |
if [ ""$#"" -ne 1 ]; then | |
echo "usage: ocrify <filename.pdf>" | |
exit 0 | |
fi | |
FILENAME=$1 | |
OCRFILE=${FILENAME//./_OCR.} |
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/ruby | |
# example using problem 4.28 from Halliday Physics book | |
# ••28 In Fig. 4-34, a stone is pro-jected at a cliff of height h | |
# with an initial speed of 42.0 m/s directed at angle u0 60.0° above | |
# the horizontal. The stone strikes at A, 5.50 s after launching. Find | |
# (a) the height h of the cliff, (b) the speed of the stone just before | |
# impact at A, and (c) the maximum height H reached above the ground. | |
class Fixnum |
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
weekchooser = -> | |
$('#datepicker').datepicker({ | |
dateFormat: "M d, yy", | |
altFormat: "M d, yy", | |
altField: "#actualdate", | |
selectWeek: true, | |
firstDay: 1, | |
showOtherMonths: true, | |
selectOtherMonths: true, | |
beforeShow: -> |
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
#!/bin/bash | |
HOME=/Users/username #replace username with your actual username | |
ITDIR=$HOME/Music/iTunes/iTunes\ Media/Podcasts/ | |
DBDIR=$HOME/Dropbox/Podcasts/ | |
rm -rf $DBDIR/* find “$ITDIR” -type f -size -39999k -print0 | xargs -0 -I file ln -s file $DBDIR |