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
| #include <NewtonGestalt.h> | |
| #include <NewtonScript.h> | |
| #include <BufferList.h> | |
| #include <BufferSegment.h> | |
| class TGPIOInterface | |
| { | |
| public: | |
| NewtonErr ReadGPIOData (UByte, ULong *); | |
| }; |
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 "Mail" | |
| set _sel to get selection | |
| if (count of _sel) > 1 then | |
| -- multiple message selection, usually a conversation thread | |
| choose from list {"Reply", "Reply All"} with prompt "Unknown recipient count." default items {"Reply"} | |
| try | |
| set _menu_command to item 1 of the result | |
| on error | |
| return |
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
| # To disable Safari’s annoying modal local database | |
| # storage dialog, use this Terminal command: | |
| defaults write com.apple.Safari WebKitDatabasesEnabledPreferenceKey -bool false | |
| # To disable local storage altogether, use this command: | |
| defaults write com.apple.Safari WebKitLocalStorageEnabledPreferenceKey -bool false |
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
| mysqldump -u MYSQL_USERNAME -p YOUR_DATABASE | gzip -c | ssh USERNAME@YOUR_TO_HOST 'cat > ~/dump.sql.gz' |
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
| <?php | |
| /** | |
| * Looks for unquoted keys in a json string and fixes them ie: {a:"b"} => {"a":"b"} | |
| * @param string $string A json string that is suspect | |
| * @return string A valid json string | |
| */ | |
| function fix_json($string){ | |
| // (no qupte) (word) (no quote) (semicolon) | |
| $regex = '/(?<!")([a-zA-Z0-9_]+)(?!")(?=:)/i'; |
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
| # If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer! | |
| export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ " | |
| # This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty! | |
| # ~/code/web:beta_directory$ git checkout master | |
| # Switched to branch "master" | |
| # ~/code/web:master$ git checkout beta_directory | |
| # Switched to branch "beta_directory" |
NewerOlder