This file contains hidden or 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
def score(dice) | |
total = 0 | |
return 0 if dice.empty? | |
total += 1000 if dice.count(1) >= 3 | |
total += 200 if dice.count(2) >= 3 | |
total += 300 if dice.count(3) >= 3 | |
total += 400 if dice.count(4) >= 3 | |
total += 500 if dice.count(5) >= 3 | |
total += 600 if dice.count(6) >= 3 | |
total += 100 if dice.count(1) == 1 || dice.count(1) == 4 |
This file contains hidden or 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
now = new Date() | |
year = now.getFullYear() | |
day = now.getDate() | |
month = now.getMonth()+1 | |
console.log "#{year}-#{month}-#{day}" |
This file contains hidden or 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/zsh | |
# This script assumes you're using @codekit-prepend to import dependencies. | |
mkdir $1 | |
cd $1 | |
mkdir coffee | |
mkdir css | |
mkdir sass | |
mkdir js |
This file contains hidden or 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
Show hidden characters
{ | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme", | |
"font_size": 18, | |
"open_files_in_new_window": false, | |
"show_encoding": true, | |
"show_line_endings": true, | |
"tab_size": 2, | |
"translate_tabs_to_spaces": true, | |
"theme": "Spacegray.sublime-theme" |
This file contains hidden or 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
fs.readFile('test.md', {encoding: 'UTF-8'},function (err, data) { | |
if (err) throw err; | |
console.log(data); | |
}); |
This file contains hidden or 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
fs.appendFile('test.md', "data to append part 2", function (err) { | |
if (err) throw err; | |
console.log('The "data to append" was appended to file!'); | |
}); |
This file contains hidden or 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
tell application "iTerm" | |
make new terminal | |
tell the first terminal | |
activate first session | |
launch session "Default Session" | |
tell the last session | |
write text "{popclip text}" | |
end tell | |
end tell | |
end tell |
This file contains hidden or 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/zsh | |
cd ~/Dropbox/Documents/Markdown | |
grep -rl '@reminded' ./ | xargs sed -i '' -E 's/@reminded.+$//g' |
This file contains hidden or 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
tell application "OmniFocus" | |
tell default document | |
set incomplete to every inbox task where completed is false | |
count incomplete | |
end tell | |
end tell |
This file contains hidden or 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
tell application "Finder" | |
set _question to display dialog "Please enter file name..." default answer "" with title "New File" | |
set _file to text returned of _question | |
set _target to target of front window as alias | |
set _path to POSIX path of _target | |
set full_name to quoted form of _path & _file | |
do shell script "touch " & full_name | |
end tell |