This is a short set of functions that use the httr package to upload a directory of files as a gist. The post_gist function uploads an anonymous gist, which can only be deleted within a short time of being uploaded. So be cautious in what you upload using this function.
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
| [ | |
| { | |
| "args": null, | |
| "command": "select_all" | |
| }, | |
| { | |
| "args": | |
| { | |
| "set_translate_tabs": true | |
| }, |
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 "Evernote" | |
| set myNote to selection | |
| try | |
| set myUrl to (source URL of item 1 of myNote) | |
| tell application "System Events" | |
| open location myUrl | |
| end tell | |
| on error | |
| -- real programmers would put something here | |
| end try |
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 "System Events" | |
| tell process "Finder" | |
| if window 1 exists then | |
| tell application "Finder" | |
| set thePath to get quoted form of POSIX path of (target of front Finder window as text) | |
| return "cd " & thePath & return | |
| end tell | |
| else | |
| display alert "Finder doesn't have a window open." as warning giving up after 2 | |
| end if |
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
| " Set colorscheme to solarized | |
| colorscheme solarized | |
| " Change the Solarized background to dark or light depending upon the time of | |
| " day (5 refers to 5AM and 17 to 5PM). Change the background only if it is not | |
| " already set to the value we want. | |
| function! SetSolarizedBackground() | |
| if strftime("%H") >= 5 && strftime("%H") < 17 | |
| if &background != 'light' | |
| set background=light |
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
| ———————————————————————————————————————————————————————————————————————————————————————————————————— | |
| BBEdit / BBEdit-Lite / TextWrangler Regular Expression Guide Modified: 2018/08/10 01:19 | |
| ———————————————————————————————————————————————————————————————————————————————————————————————————— | |
| NOTES: | |
| The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use. | |
| Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete. |
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
| # A simple Evernote API demo script that lists all notebooks in the user's | |
| # account and creates a simple test note in the default notebook. | |
| # | |
| # Before running this sample, you must fill in your Evernote developer token! | |
| # | |
| # This sample is part of the Evernote SDK and has been modified slightly for | |
| # Pythonista, to take advantage of the clipboard and PIL modules. | |
| # If there is an image in the clipboard when the script is run, it is attached | |
| # to the sample note. |
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
| set theDate to (current date) | |
| set theStartDate to theDate | |
| repeat until weekday of theStartDate = Sunday | |
| set theStartDate to theStartDate - 1 * days | |
| end repeat | |
| set theEndDate to theDate | |
| repeat until weekday of theEndDate = Saturday | |
| set theEndDate to theEndDate + 1 * days | |
| end repeat | |
| set theDate to (short date string of theStartDate) & " - " & (short date string of theEndDate) |
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
| # Date parsing for Things | |
| # by Cormac Relf - cormacrelf.com - @cormacrelf | |
| # depends on parsedatetime | |
| # use the .py files extracted from v0.8.7 from here: https://gist.github.com/4583376 | |
| # alternatively: | |
| # download pipista; https://gist.github.com/4116558 | |
| # in the plain Pythonista console, type `import pipista`, then `pipista.pypi_download("parsedatetime")` | |
| # download shellista; https://gist.github.com/4139094 | |
| # running shellista, enter the following commands, which have been shortened for your convenience: |
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
| # Iterates over files and subdirectories in directorie[s] given as arguments | |
| # and adds raw text of those files to merged.txt in the working directory | |
| # where the script is called | |
| # Call like this: | |
| # ruby merge.rb {absolute path portion to delete} {directory to scan} [{directory to scan}] | |
| # For example: | |
| # ruby merge.rb /Users/donnieclapp/Projects/ ~/Projects/htl-website/myproject/static_media/stylesheets | |
| # create or open the merged.txt file for writing (in working directory) |