Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+C | copy current line (if no selection) |
| Ctrl+X | cut current line (if no selection) |
| Ctrl+⇧+K | delete line |
| Ctrl+↩ | insert line after |
| <?php | |
| /** | |
| * Example usage (using jQuery): | |
| * var url = "/path/mantisconnect_json.php?name=mc_project_get_issues&project_id=0&page_number=1&per_page=10"; | |
| * $.getJSON(url, function(data) { | |
| * $.each(data, function() { | |
| * console.log(data.id + ': ' data.summary); | |
| * }); | |
| * }); | |
| */ |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+C | copy current line (if no selection) |
| Ctrl+X | cut current line (if no selection) |
| Ctrl+⇧+K | delete line |
| Ctrl+↩ | insert line after |
Go to Sublime Text 2 > Preferences > Key Bindings - User and add this JSON to the file:
[
{
"keys": ["super+shift+l"],
"command": "insert_snippet",
"args": {
"contents": "console.log(${1:}$SELECTION);${0}"
}, | /* | |
| Complete buildable project containing minimum sample code to reproduce bug: | |
| https://dl.dropboxusercontent.com/u/20181/TextOverflowModeFill-bug.zip | |
| Bug description: | |
| Using a TextLayer with GTextOverflowModeFill seems to position the | |
| leading 'j' out of place in wrapped words starting with 'j'. | |
| Example screenshot of the 'j' out of place: |
| import json | |
| top = '.' | |
| out = 'build' | |
| def options(ctx): | |
| ctx.load('pebble_sdk') | |
| def configure(ctx): | |
| ctx.load('pebble_sdk') |
| var INTERVAL = 5; | |
| var list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; | |
| list.reduce(function(result, value, index) { | |
| var i = Math.floor(index/INTERVAL); | |
| result[i] ? result[i] += value : result[i] = value; | |
| return result; | |
| }, []); | |
| // Output: [15, 40, 11] |
| // validate Swedish Personal Identity Number (personnummer) using checksum | |
| // note: this is somewhat simplified because it does not take into account | |
| // that the date of the number is valid (e.g. "000000-0000" does return as true) | |
| function isValidSwedishPIN(pin) { | |
| pin = pin | |
| .replace(/\D/g, "") // strip out all but digits | |
| .split("") // convert string to array | |
| .reverse() // reverse order for Luhn | |
| .slice(0, 10); // keep only 10 digits (i.e. 1977 becomes 77) |
| { | |
| "@attributes": { | |
| "BloodBankCode": "021" | |
| }, | |
| "RunTime": "2015-06-03T10:48:04", | |
| "StockLevel": [ | |
| { | |
| "@attributes": { | |
| "BloodGroup": "0+" | |
| }, |
| function get(obj, path) { | |
| var parts = path.split(/\]\[|\]\.|\[|\]|\./); | |
| return parts | |
| .reduce(function(o, x) { | |
| return (typeof o == "undefined" || o === null) ? x : o[x]; | |
| }, obj); | |
| } | |
| // example: get(obj, "prop.foo[0][2].bar[3].zoom") |
| { | |
| "conditions": [ | |
| { | |
| "id": "D001", | |
| "value": "barn" | |
| } | |
| ], | |
| "id": "PERSONNUMMERID", | |
| "label": "Personnummer för barnet", | |
| "placeholder": "ååååmmddxxxx", |