REFERENCES FOR LEARNING & USING APPLESCRIPT Modified: 2018/06/19 18:47
AppleScript is a rather peculiar scripting language to learn.
| #!/bin/sh | |
| # on ubuntu: need some utils & dev libs | |
| sudo apt-get install apache2-utils openssl libssl-dev libpcre3-dev | |
| # compile nginx | |
| cd /tmp | |
| curl http://nginx.org/download/nginx-0.7.64.tar.gz | tar xz | |
| cd nginx* | |
| ./configure --with-http_ssl_module --with-http_dav_module \ |
| - (NSString *)stripOutHttp:(NSString *)httpLine { | |
| // Setup an NSError object to catch any failures | |
| NSError *error = NULL; | |
| // create the NSRegularExpression object and initialize it with a pattern | |
| // the pattern will match any http or https url, with option case insensitive | |
| NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"https?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?" options:NSRegularExpressionCaseInsensitive error:&error]; | |
| // create an NSRange object using our regex object for the first match in the string httpline | |
| NSRange rangeOfFirstMatch = [regex rangeOfFirstMatchInString:httpLine options:0 range:NSMakeRange(0, [httpLine length])]; | |
| // check that our NSRange object is not equal to range of NSNotFound | |
| if (!NSEqualRanges(rangeOfFirstMatch, NSMakeRange(NSNotFound, 0))) { |
| (* | |
| Jered Benoit | |
| jeredb.com | |
| Omnifocus -> Day One Daily Completed Task Log | |
| Based upon [Version 1.0] [1] of [OmniFocus - Weekly Project Report Generator] [2] | |
| Originally Authored by Chris Brogan and Rob Trew | |
| February 5, 2012 |
| -- This property controls whether full project paths (including parent folders) are displayed | |
| property includeFullProjectPaths : true | |
| -- These properties control whether additional task content is displayed | |
| property includeTaskContext : true | |
| property includeTaskEstimatedTime : true | |
| property includeTaskStartDate : true | |
| property includeTaskModificationDate : true | |
| property includeTaskCompletionDate : true | |
| property includeTaskNotes : true |
| (* PROPERTIES *) | |
| property LF : (ASCII character 10) | |
| property LF1 : (ASCII character 32) & (ASCII character 32) & (ASCII character 10) | |
| property tid : AppleScript's text item delimiters | |
| (* THE SCRIPT *) | |
| tell application "Skim" | |
| set theTextStatus to display dialog "Is the PDF a Primary or Secondary text?" buttons {"Primary", "Secondary"} default button {"Secondary"} | |
| property markdownloc : "/usr/local/bin/multimarkdown" | |
| property tid : AppleScript's text item delimiters | |
| set mdSource to the clipboard | |
| --check for Title metadata | |
| try | |
| if text item 1 of paragraph 1 of mdSource = "#" then | |
| if not text item 2 of paragraph 1 of mdSource = "#" then | |
| set theTitle to text items 3 thru -1 of paragraph 1 of mdSource as string |
| (* EVERNOTE TO MARKDOWN | |
| --Stephen Margheim | |
| --11/9/13 | |
| --open source | |
| REQUIREMENTS | |
| --Satimage osax plugin | |
| --Aaron Swartz's html2text python script | |
| --Evernote |
| ## Unity ## | |
| *.cs diff=csharp text | |
| *.cginc text | |
| *.shader text | |
| *.mat merge=unityyamlmerge eol=lf | |
| *.anim merge=unityyamlmerge eol=lf | |
| *.unity merge=unityyamlmerge eol=lf | |
| *.prefab merge=unityyamlmerge eol=lf |
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.