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
| require "nokogiri" | |
| require "open-uri" | |
| url = "https://developer.apple.com/videos/play/fall2017" | |
| base_url = "#{URI(url).scheme}://#{URI(url).host}" | |
| html = Nokogiri::HTML(open(url)) | |
| pages = html.css("section.col-70 > a").map { |a| base_url + a[:href] } | |
| pages.each do |page| |
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
| struct JSONResource { | |
| static func dictionary(fromResource filename: String, ofType type: String) -> [String: AnyObject]? { | |
| return object(fromResource: filename, ofType: type) as? [String: AnyObject] | |
| } | |
| static func array(fromResource filename: String, ofType type: String) -> [AnyObject]? { | |
| return object(fromResource: filename, ofType: type) as? [AnyObject] | |
| } |
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
| { | |
| "cmd": ["clang", "$file", "-std=c99", "-framework", "Foundation", "-ObjC", "-o", "$file_base_name"], | |
| "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", | |
| "working_dir": "${file_path}", | |
| "selector": "source.objc, source.m", | |
| "variants": | |
| [ | |
| { | |
| "name": "Run", |
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
| property message : "Toggle screenshot shadow?" | |
| property remove_button : "Remove Shadow" | |
| property keep_button : "Keep Shadow" | |
| set dialog to display dialog message buttons {"Cancel", remove_button, keep_button} default button keep_button cancel button "Cancel" | |
| if button returned of dialog is remove_button then | |
| do shell script "defaults write com.apple.screencapture disable-shadow -bool true && killall SystemUIServer" | |
| else if button returned of dialog is keep_button then | |
| do shell script "defaults delete com.apple.screencapture disable-shadow && killall SystemUIServer" |
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
| #!/usr/bin/env ruby -wKU | |
| # encoding: utf-8 | |
| # Adapted from: | |
| # - Martin Kopichke's "Markdown to Evernote" service | |
| # https://gist.github.com/kopischke/1009149 | |
| # - Benabik's arkdown to Evernote, RubyCocoa edition | |
| # https://gist.github.com/Benabik/4743741 | |
| # - Brett Terpstra’s post | |
| # http://brettterpstra.com/a-better-os-x-system-service-for-evernote-notes-with-multimarkdown/ |
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
| -- | |
| -- Open with Sublime Text 2 | |
| -- | |
| -- Open Finder selections or current directory using Sublime Text 2 command line tool. | |
| -- Save the script as application and drag it to the Finder toolbar. | |
| -- | |
| -- Action on double clicking the icon | |
| on run |
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
| -- When double clicking the icon | |
| on run | |
| set selectedItems to (choose file with multiple selections allowed) | |
| repeat with thisItem in selectedItems | |
| my run_hdiutil(thisItem) | |
| end repeat | |
| end run | |
| -- When dragging files onto the icon |
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
| -- involve GUI | |
| tell application "Disk Utility" to activate | |
| delay 1 -- wait for the good old mac to get ready | |
| tell application "Disk Utility" to activate | |
| tell application "System Events" | |
| tell process "Disk Utility" | |
| select row 2 of outline 1 of scroll area 1 of splitter group 1 of window 1 | |
| click button 3 of group 1 of tab group 1 of splitter group 1 of window 1 |
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
| // javascript: | |
| fontName = prompt("Try Merienda, Risque, or more on https://www.google.com/webfonts", "Merienda"); | |
| WebFontConfig = { | |
| google: { families: [ fontName.replace(/\ /, "+") + '::latin' ] } | |
| }; | |
| (function() { | |
| var wf = document.createElement('script'); |
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
| -- When double clicking the icon | |
| on run | |
| set selectedItems to (choose file with multiple selections allowed) | |
| repeat with thisItem in selectedItems | |
| my subRoutine(thisItem) | |
| end repeat | |
| end run | |
| -- When dragging files onto the icon |
NewerOlder