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 StrategySelector { | |
private var strategy: (() -> Void)! | |
private var state: String = "" | |
init() { | |
strategy = strategyA | |
} | |
func execute() { |
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/sh | |
# Prequisite: Using Mac OS and having VLC Media Player installed | |
# Usage: `freq 432 /path/to/song` | |
vlc () { /Applications/VLC.app/Contents/MacOS/VLC -I rc "$@" ;} | |
LC_NUMERIC="en_US.UTF-8" \ | |
rate=$(printf "%0.6f\n" $(bc -q <<< scale=6\;$1/440)) | |
vlc -Irc --rate "$rate" "$2" |
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 mindNodeFile to choose file | |
set fileExtension to "mindnode" | |
tell application "/Applications/MindNode.app" | |
open (mindNodeFile as alias) | |
set mindNodeDocument to document 1 | |
set fileName to POSIX path of (mindNodeFile as alias) | |
set baseName to (characters 1 thru -((count of fileExtension) + 3) of fileName) as string | |
set exportFile to ((baseName & ".pdf") as POSIX file) | |
tell mindNodeDocument to export to exportFile as PDF | |
close window 1 without saving |