Skip to content

Instantly share code, notes, and snippets.

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@milkbread
milkbread / argsKwargsDemo.py
Last active August 29, 2015 13:57
Python: simple example on *args and **kwargs
#!/usr/bin/env python
def func(arg, *args, **kwargs):
print arg
if args:
print args
if kwargs:
print kwargs
def main():
func('hello')
@milkbread
milkbread / index.html
Created March 21, 2014 14:47
Testing grids
<!DOCTYPE html>
<html>
<head>
<title>Testing html grids</title>
<style type="text/css">
.row {
width:300px;
border:2px solid;
display:inline-block;
float:none;
@milkbread
milkbread / de.json
Last active August 29, 2015 13:58 — forked from mbostock/.block
German states in a forced layout
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@milkbread
milkbread / d3.v3.min.js
Last active August 29, 2015 14:00
Testing mosaics
!function(){function n(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function t(n){return null!=n&&!isNaN(n)}function e(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function r(n){return n.length}function u(n){for(var t=1;n*t%1;)t*=10;return t}function i(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(r){n.prototype=t}}function o(){}function a(n){return ha+n in this}function c(n){return n=ha+n,n in this&&delete this[n]}function s(){var n=[];return this.forEach(function(t){n.push(t)}),n}function l(){var n=0;for(var t in this)t.charCodeAt(0)===ga&&++n;return n}function f(){for(var n in this)if(n.charCodeAt(0)===ga)return!1;return!0}function h(){}function g(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function p(n,
@milkbread
milkbread / basic.html
Created July 12, 2014 14:17
BarChartExperiment
<html>
<head>
<title>BarChartExperiment</title>
<script src="http://d3js.org/d3.v3.min.js"></script>
<style type="text/css">
.chart div {
font: 10px sans-serif;
background-color: green;
padding: 3px;
margin: 1px;
@milkbread
milkbread / circChartStyles.css
Created July 12, 2014 17:24
circulaChartExperiment
div.circChart {
display: inline-block;
margin: 6px;
}
div.legend {
display: inline-block;
vertical-align: top;
margin-left: 20px;
}
@milkbread
milkbread / index.html
Created July 15, 2014 17:34
FotoramaFullscreen
<!DOCTYPE html>
<html>
<head>
<title>Fullscreen</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<!-- jQuery, -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
@milkbread
milkbread / RKToolbox.js
Last active December 18, 2015 01:48
JavaScript: Timeline example
//should be able to define: indicWidth, indicSideWidth
function timeLine(container,width,height){
//initialize some variables
var indicWidth = 12, indicSideWidth = 4, indicatorGroup, indicatorLeftpart, indicatorRightpart, indicatorLeft, indicatorRight;
var axisScale = d3.time.scale();
var timelineSVG = container.append("svg")
.attr("width", width)
@milkbread
milkbread / index.html
Last active December 18, 2015 02:39
Gist_Demonstration
<!DOCTYPE html>
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<style>
</style>
</head>
<body>
<div id=content></div>