Given #f7dd37
, this workflow will generate a line like this [UIColor colorWithRed:247.0 / 255.0 green:221.0 / 255.0 blue:55.0 / 255.0 alpha:1.0]
and paste it into the frontmost application.
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
SELECT t.alias, p.token | |
FROM ts_parse('default', 'http://www.postgresql.org/docs/9.4/static/textsearch-parsers.html') AS p | |
NATURAL JOIN ts_token_type('default') AS t; | |
-- alias | token | |
-- ----------+------------------------------------------------------------ | |
-- protocol | http:// | |
-- url | www.postgresql.org/docs/9.4/static/textsearch-parsers.html | |
-- host | www.postgresql.org | |
-- url_path | /docs/9.4/static/textsearch-parsers.html |
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
import Dispatch | |
func dispatch_async(queue: dispatch_queue_t = dispatch_get_main_queue(), block: dispatch_block_t) { | |
Dispatch.dispatch_async(queue, block) | |
} | |
dispatch_async { | |
// Update the UI | |
} |
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
tell application "Finder" | |
eject (every disk whose ejectable is true) | |
end tell |
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
osascript -e 'tell application "Finder" to eject (every disk whose ejectable is true)' |
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
quicksort :: (Ord a) => [a] -> [a] | |
quicksort [] = [] | |
quicksort (x:xs) = quicksort (filter (< x) xs) ++ [x] ++ quicksort (filter (>= x) xs) |
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 | |
README = "README.md" | |
unless File.exist? README | |
puts 'No README file found' | |
exit 1 | |
end | |
`open -a Marked #{README}` |
This also works as a short and out-of-the-box alternative:
DispatchQueue.main.asyncAfter(deadline: .now() + 5.0 ) { /* */ }
Thanks to:
public func +(time: DispatchTime, seconds: Double) -> DispatchTime
OS X Mountain Lion ships with two new apps, Reminders and Notes, which are basically OS X counterparts of the standard iOS apps with the same names. One nice thing about these new apps is that they are scriptable.
This means that I was able to create two simple AppleScripts and thus an Alfred extensions to make a new reminder in the default list and to make a new note in the default folder.
You can view the sources of the AppleScripts below.
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
def subsequences(count, seq = range(5, 40, 5), target = 100, partial = []): | |
if count == 0: | |
return | |
s = sum(partial) | |
if s >= target: | |
return | |
if s == target or (count == 1 and (target - s) in seq): |
OlderNewer