Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| " VIM Configuration File | |
| " Description: Optimized for C/C++ development, but useful also for other things. | |
| " Author: Gerhard Gappmeier | |
| " | |
| " set UTF-8 encoding | |
| set enc=utf-8 | |
| set fenc=utf-8 | |
| set termencoding=utf-8 | |
| " disable vi compatibility (emulation of old bugs) |
| # -*- coding: utf-8 -*- | |
| import Image | |
| def resize_and_crop(img_path, modified_path, size, crop_type='top'): | |
| """ | |
| Resize and crop an image to fit the specified size. | |
| args: | |
| img_path: path for the image to resize. |
| license: gpl-3.0 | |
| redirect: https://observablehq.com/@d3/margin-convention |
Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| Here is a list of scopes to use in Sublime Text 2 snippets - | |
| ActionScript: source.actionscript.2 | |
| AppleScript: source.applescript | |
| ASP: source.asp | |
| Batch FIle: source.dosbatch | |
| C#: source.cs | |
| C++: source.c++ | |
| Clojure: source.clojure | |
| CoffeeScript: source.coffee |
I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).
In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.
An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.
Here's how it should work:
| import json | |
| import tornado.web | |
| class JsonHandler(BaseHandler): | |
| """Request handler where requests and responses speak JSON.""" | |
| def prepare(self): | |
| # Incorporate request JSON into arguments dictionary. | |
| if self.request.body: | |
| try: |
| /*jslint devel: true, indent: 2 */ | |
| // 15.2.3.2 | |
| if (!Object.setPrototypeOf) { | |
| Object.setPrototypeOf = (function(Object, magic) { | |
| 'use strict'; | |
| var set; | |
| function checkArgs(O, proto) { | |
| if (typeof O !== 'object' || O === null) { | |
| throw new TypeError('can not set prototype on a non-object'); | |
| } |
| /** | |
| * Generates number of random geolocation points given a center and a radius. | |
| * @param {Object} center A JS object with lat and lng attributes. | |
| * @param {number} radius Radius in meters. | |
| * @param {number} count Number of points to generate. | |
| * @return {array} Array of Objects with lat and lng attributes. | |
| */ | |
| function generateRandomPoints(center, radius, count) { | |
| var points = []; | |
| for (var i=0; i<count; i++) { |
| /* Solarized Dark | |
| For use with Jekyll and Pygments | |
| http://ethanschoonover.com/solarized | |
| SOLARIZED HEX ROLE | |
| --------- -------- ------------------------------------------ | |
| base03 #002b36 background | |
| base01 #586e75 comments / secondary content |