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 |
| this.before(function(){ | |
| var res = this.response; | |
| if ('OPTIONS' == this.request.method) { | |
| res.setHeaders(200,{ | |
| 'Content-Type': 'text/plain', | |
| 'Access-Control-Allow-Origin': '*', | |
| 'Access-Control-Allow-Methods': 'GET, PUT, POST, DELETE, OPTIONS', | |
| 'Access-Control-Allow-Headers': 'Content-Type, Authorization, X-Requested-With', | |
| 'Access-Control-Max-Age': 5184000 //2 months |
| @With(Compress.class) | |
| public class Application extends Controller { | |
| public static void index() { | |
| render();//response will be gzipped | |
| } | |
| } |
| sudo apt-get install build-essential libssl-dev curl | |
| # The install script | |
| # Adapted from https://gist.github.com/579814 | |
| echo '# Added by install script for node.js and npm in 30s' >> ~/.bashrc | |
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| echo 'export NODE_PATH=$HOME/local/lib/node_modules' >> ~/.bashrc | |
| . ~/.bashrc |
| <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../config/ehcache.xsd" updateCheck="false"> | |
| <!-- This is a default configuration for 256Mb of cached data using the JVM's heap, but it must be adjusted | |
| according to specific requirement and heap sizes --> | |
| <defaultCache | |
| maxBytesLocalHeap="256000000" | |
| eternal="false" | |
| timeToIdleSeconds="120" | |
| timeToLiveSeconds="120" |
| // JavaScript `this` examples from http://stackoverflow.com/a/12371105/477168 | |
| // The value of this in a function is sometimes called the "context" in which | |
| // the function runs. The most important thing to understand is that a function | |
| // object does not have a fixed context -- the value of this changes depending | |
| // on how the function is called. | |
| // If the function is called as a "raw" function (e.g., just do someFunc()), | |
| // this will be window (or undefined if the function runs in strict mode). |
| package com.badlogic.drop; | |
| import com.badlogic.gdx.Game; | |
| import com.badlogic.gdx.graphics.g2d.BitmapFont; | |
| import com.badlogic.gdx.graphics.g2d.SpriteBatch; | |
| public class Drop extends Game { | |
| SpriteBatch batch; | |
| BitmapFont font; |
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 |
| var http = require("http"), | |
| url = require("url"), | |
| path = require("path"), | |
| fs = require("fs") | |
| port = process.argv[2] || 4002; | |
| http.createServer(function(request, response) { | |
| var uri = url.parse(request.url).pathname |
| // Send cookies for the socket.io handshake (sails.js) | |
| // Based on https://gist.github.com/jfromaniello/4087861 | |
| // Socket.io open ticket (started by jfromaniello): | |
| // https://github.com/LearnBoost/socket.io-client/pull/512 | |
| var io = require('socket.io-client'); | |
| var request = require('request'); | |
| var xhr = require('socket.io-client/node_modules/xmlhttprequest'); | |
| var xhrOriginal = require('xmlhttprequest'); |
| window.console.clog = function(log){ | |
| var message = typeof log === 'object' ? '%cLooks like you\'re trying to log an ' : '%cLooks like you\'re trying to log a ', | |
| style = 'background:url(http://i.imgur.com/SErVs5H.png);padding:5px 15px 142px 19px;line-height:280px;'; | |
| console.log.call(console, message + typeof log + '.', style); | |
| }; |