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
| // For the purposes of this gist, assume we have declared the variable str and it is actually a string. | |
| var str = "This is my awesome string. \n I love strings. \n\t\t\t Stringy string string! \n\t\t\t\tWhat??"; | |
| // Regex to remove all tabs and newlines. | |
| str = str.replace(/[\t]|[\n]/gm, ''); | |
| // Regex to replace all sets of 2 or more space characters with a single space | |
| str = str.replace(/\s{2,}/g, ' '); | |
| // Regex to remove all HTML comments |
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
| [ | |
| { | |
| "keys": [ | |
| "alt+g" | |
| ], | |
| "command": "toggle_setting", | |
| "args": { | |
| "setting": "gutter" | |
| } | |
| }, |
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
| <html> | |
| <head> | |
| // Blah Blah Blah | |
| </head> | |
| <body> | |
| <script type="text/javascript"> | |
| /** | |
| * We make absolutely positive that the first thing on the stack is our timer starting. | |
| */ | |
| // And away we go! |
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
| git log --pretty=format:'%s' | tr '[:upper:]' '[:lower:]' | tr '[:space:]' '\n' | sort | uniq -c | sort -nr | grep -iE "(fuck|shit|bitch|damn|hate|ugly|stupid|asshole|moron|eff|worthless|piss)" |
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
| <script type="x-handlebars-template" id="messages_messageListItem"> | |
| <div class="list"> | |
| <div class="sub"> | |
| <div class="subject"> | |
| {{subject}} | |
| </div> | |
| <div class="notification"> | |
| {{unread}} | |
| </div> | |
| <div class="message"> |
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
| $(function() { | |
| var badge_unreadMessages = $("#unread_message_count"); | |
| // Script to check for notifications runs | |
| // If the script comes back with new notifications: | |
| badge_unreadMessages.text( parseInt( badge_unreadMessages.text() ) + 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
| { | |
| "Success": true, | |
| "ResultsReturned": 1, | |
| "TotalResults": 1065493, | |
| "Artists": [ | |
| { | |
| "MnetId": "1097", | |
| "Name": "Alicia Keys", | |
| "Images": { | |
| "Artist180x80": "http://images.mndigital.com/artists/000/001/097/b.jpeg", |
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 | |
| private function dig( $obj , $level = 0 ) { | |
| $return = ""; | |
| $tabs = str_repeat( "\t" , $level ); | |
| foreach( $obj as $k => $v ) { | |
| if( self::keyed( $v ) ) { | |
| $return .= $tabs . "$k object: \n"; |
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
| var githubSchema = new Schema({ | |
| "url": String, | |
| "html_url": String, | |
| "number": Number, | |
| "state": String, | |
| "title": String, | |
| "body": String, | |
| "user": { | |
| "login": String, | |
| "id": Number, |
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
| class Snippets { | |
| public $snips; | |
| function __construct() { | |
| $this->snips = new stdClass; | |
| } |