Step one is to install Exuberant Ctags on your system. For those on an Ubuntu system, this is as simple as:
sudo apt-get install ctags
| // Settings in here override those in "Default/Preferences.sublime-settings", and | |
| // are overridden in turn by file type specific settings. | |
| { | |
| // Sets the colors used within the text area | |
| "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
| // Set to false to prevent line numbers being drawn in the gutter | |
| "line_numbers": true, |
| # Thanks to @samsonjs for the cleaned up version: | |
| # https://gist.github.com/samsonjs/4076746 | |
| PREFIX=$HOME | |
| VERSION=1.2.3 | |
| # Install Protocol Buffers | |
| wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.bz2 | |
| tar -xf protobuf-2.4.1.tar.bz2 | |
| cd protobuf-2.4.1 |
| { | |
| "auto_complete": true, | |
| "auto_complete_commit_on_tab": false, | |
| "auto_complete_delay": 50, | |
| "auto_complete_selector": "source - comment", | |
| "auto_complete_size_limit": 4194304, | |
| "auto_complete_triggers": | |
| [ | |
| { | |
| "characters": "<", |
| { | |
| //Turn on tab completing over hitting enter | |
| "auto_complete_commit_on_tab": true, | |
| //Auto indenting on new line within block | |
| "auto_indent": true, | |
| //Mine is Solarized Dark | |
| "color_scheme": "Your theme of choice", |
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
These examples are type 3 RESTful API requests and responses. The JSON-HAL specification is used to implement HATEOAS.
Some of the examples are based on my work as architect of the RESTful API at http://www.hautelook.com. All proprietary information has been removed.
For HTTP headers it's quite straightforward: draft-nottingham-http-link-header defines this.
Link: <http://example.com/>; rel="previous"; titile="Previous chapter"
| // Ever needed to escape '\n' as '\\n'? This function does that for any character, | |
| // using hex and/or Unicode escape sequences (whichever are shortest). | |
| // Demo: http://mothereff.in/js-escapes | |
| function unicodeEscape(str) { | |
| return str.replace(/[\s\S]/g, function(character) { | |
| var escape = character.charCodeAt().toString(16), | |
| longhand = escape.length > 2; | |
| return '\\' + (longhand ? 'u' : 'x') + ('0000' + escape).slice(longhand ? -4 : -2); | |
| }); | |
| } |
| #!/bin/bash | |
| # This file is for iTerm2 users. | |
| # | |
| # Put this file in /usr/local/bin/iterm-cmd-click-emacsclient | |
| # | |
| # You'll need to do the following at command line... | |
| # $ defaults write com.googlecode.iterm2 SemanticHistoryHandler /usr/local/bin/iterm-cmd-click-emacsclient | |
| emacsclient -e "(find-file \"$1\")" "(goto-line $2)" |