Skip to content

Instantly share code, notes, and snippets.

function RandomColorScheme()
let mycolors = split(globpath(&rtp,"**/colors/*.vim"),"\n")
exe 'so ' . mycolors[localtime() % len(mycolors)]
unlet mycolors
endfunction
:command NewColor call RandomColorScheme()
"call RandomColorScheme()
var Foo,
__hasProp = {}.hasOwnProperty,
var __extends = function(child, parent) {
// direct property injection of parent constructor Function
for (var key in parent) {
if (__hasProp.call(parent, key))
child[key] = parent[key];
}
fs.readFile('foo', hcb(function(data) {
// do something
});
function hcb() {
var args = [].slice.call(arguments, 0);
var err = args.shift();
if (err != null) {
handleError(err);
return;
import $ from 'jquery';
console.log($);
setTimeout(function() {
debugger;
'lol';
}, 1000);
System.paths['*'] = '*.js';
System.paths['npm:*'] = 'jspm_packages/npm/*.js';
System.paths['github:*'] = 'jspm_packages/github/*.js';
System.paths['app/*'] = 'lib/*.js';
System.map = {
'ember': 'github:components/ember@^1.4.0',
'github:components/ember': 'github:components/ember@^1.4.0',
'jquery': 'github:components/jquery@^2.1.0',
'handlebars': 'github:components/handlebars.js@^1.3.0',

Web app development entails:

  • interacting with data
  • syncing ui and data
  • responding to user interaction (dom events)
  • user flow (navigating screens)
  • url (de)serialization
<x-toggle on=false>
<x-toggle-label value="on">on</x-toggle-label>
<x-toggle-knob>
<x-toggle-label value="off">off</x-toggle-label>
</x-toggle>
<!--
all behavior is inside those components, then you can also
create a component that has *no behavior at all* but is
simply a template composing those together for your application
function delegate (child) {
// make it happen
}
// usage
var obj = {
math: {
x: 2,
function(fn, thisArg) {
var newArray = [];
for (var i = 0, l = this.length; i < l; i++) {
newArray.push(fn.call(thisArg, this[i], i, this));
}
return newArray;
};
function (childName) {
var method;
return function fn() {
if (!method) {
for (var key in this) {
if (this[key] === fn) {
method = key;
break;
}
}