Skip to content

Instantly share code, notes, and snippets.

@afonsomatos
afonsomatos / StringES6.js
Created June 17, 2015 09:46
Most important String features in ES6
// If strings starts with substr
'myString'.startsWith('my', 0 /* start searching */); // true
// If string ends with substr
'myString'.endsWith('ring', 8 /* end searching */); // true
// If strings has another substr
'myString'.includes('str', 0 /* start searching */); // true
// Multiply string
'woof '.repeat(5);
// -- Template strings
// String interpolation
@mtayseer
mtayseer / print_pkg_deps.py
Last active August 29, 2015 14:01
Print a list of all installed Python packages & their dependencies
import pkg_resources, pprint
requires = {p.key: [r.key for r in p.requires()] for p in pkg_resources.working_set}
def graph(pkg):
if not requires[pkg]:
return {pkg: {}}
return {pkg: {k: v for p in requires[pkg] for k, v in graph(p).items() }}
@lg0
lg0 / markdown.xml
Created April 10, 2012 19:58
Markdown Syntax Highlighting for Sublime text 2
<!-- copy this to YOUR_THEME.tmTheme-->
<dict>
<key>name</key>
<string>diff: deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#EAE3CA</string>