Skip to content

Instantly share code, notes, and snippets.

@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')

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 / index.html
Created January 24, 2014 18:12
FlowGraphTests
<html>
<head>
<title>Flow Graph Test</title>
<script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<script type="text/javascript">
@milkbread
milkbread / index.html
Created November 13, 2013 11:53
HTML: Leaflet: UTF: Demo of UTF-Grids
<!DOCTYPE html>
<!--Source: http://danzel.github.io/Leaflet.utfgrid/example/map.html//-->
<html>
<head>
<script src="http://cdn.leafletjs.com/leaflet-0.6.1/leaflet.js"></script>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.1/leaflet.css" />
<script src="http://danzel.github.io/Leaflet.utfgrid/src/leaflet.utfgrid.js"></script>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
@milkbread
milkbread / index.html
Created November 12, 2013 14:41
HTML: Leaflet: Overlay maps
<!DOCTYPE html>
<html>
<head>
<title>Ovleray maps</title>
<meta charset="utf-8" />
<script src="http://cdn.leafletjs.com/leaflet-0.6.1/leaflet.js"></script>
<script src="http://d3js.org/d3.v3.min.js"></script>
<style>
@import url(http://cdn.leafletjs.com/leaflet-0.6.1/leaflet.css);
.mapContainer{
@milkbread
milkbread / index.html
Created November 12, 2013 13:28
HTML: Leaflet: Compare Maps
<!DOCTYPE html>
<html>
<head>
<title>Compare maps</title>
<meta charset="utf-8" />
<script src="http://cdn.leafletjs.com/leaflet-0.6.1/leaflet.js"></script>
<script src="http://d3js.org/d3.v3.min.js"></script>
<style>
@import url(http://cdn.leafletjs.com/leaflet-0.6.1/leaflet.css);
.mapContainer{
@milkbread
milkbread / demo.json
Last active December 27, 2015 04:29
HTML: Demonstrating Algorithm Steps
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@milkbread
milkbread / lines.json
Created November 1, 2013 14:33
GeoJSON: linestrings
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@milkbread
milkbread / index.html
Created October 29, 2013 10:36
HTML: Centered map example
<!DOCTYPE html>
<html>
<head>
<title>Centered map</title>
<meta charset="utf-8" />
<script src="http://cdn.leafletjs.com/leaflet-0.6.1/leaflet.js"></script>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<style>
@import url(http://cdn.leafletjs.com/leaflet-0.6.1/leaflet.css);
@milkbread
milkbread / index.html
Created October 24, 2013 10:59
JavaScript: Comparison Snakes and Visvalingam
<!DOCTYPE html>
<html>
<head>
<title>Comparison</title>
<meta charset="utf-8" />
<script src="http://cdn.leafletjs.com/leaflet-0.6.1/leaflet.js"></script>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://mourner.github.io/simplify-js/simplify.js"></script>
<script src="linestrings.json"></script>
<style>