Abbreviation: desc
Template text:
describe("$description$", function () {
it("should $it$", function () {
$content$
});
});
Abbreviation: desc
Template text:
describe("$description$", function () {
it("should $it$", function () {
$content$
});
});
Look at the README. |
// 1. trimming and padding | |
// https://github.com/tc39/proposal-string-left-right-trim | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/TrimLeft | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart | |
console.log(" 123 ".trim() === "123"); // true | |
console.log(" 123 ".trimStart() === "123 "); // true | |
console.log(" 123 ".trimEnd() === " 123"); // true | |
console.log("123".padStart(6, "0")); // 000123 |
// Mocked Service | |
angular.module('mock.users', []). | |
factory('UserService', function($q) { | |
var userService = {}; | |
userService.get = function() { | |
return { | |
id: 8888, | |
name: "test user" | |
} |
// This event emitter emits events, but reserves the right to publish events to | |
// for its creator. It uses a WeakMap for true encapsulation. | |
const eesToEventMaps = new WeakMap(); | |
export default class EventEmitter { | |
constructor(publisher) { | |
const eventMap = Object.create(null); | |
eesToEventMaps.set(this, eventMap); |
// Declare the color as RGB; SASS will treat this as hex | |
$green: rgb(27,224,63); | |
// Declare an alpha | |
$alpha: .5; | |
// Declare another color variable as a color with an alpha | |
$greenAlpha: rgba($green, $alpha); | |
body { | |
/* As RGB (which SASS actually ouputs as HEX) */ | |
background: $green; |
alias gityolo='git commit -am "DEAL WITH IT" && git push -f origin master' |
// Copied from: https://ethfiddle.com/09YbyJRfiI | |
// CryptoKitties Source code | |
// Copied from: https://etherscan.io/address/0x06012c8cf97bead5deae237070f9587f8e7a266d#code | |
pragma solidity ^0.4.11; | |
/** | |
* @title Ownable | |
* @dev The Ownable contract has an owner address, and provides basic authorization control |
You don't really need a framework or fancy cutting-edge JavaScript features to do two-way data binding. Let's start basic - first and foremost, you need a way to tell when data changes. Traditionally, this is done via an Observer pattern, but a full-blown implementation of that is a little clunky for nice, lightweight JavaScript. So, if native getters/setters are out, the only mechanism we have are accessors:
var n = 5;
function getN() { return n; }
function setN(newN) { n = newN; }
console.log(getN()); // 5
setN(10);
package.json
, set version
to a prerelease version, e.g. 2.0.0-rc1
, 3.1.5-rc4
, ...npm pack
to create packagenpm publish <package>.tgz --tag next
to publish the package under the next
tagnpm install --save package@next
to install prerelease package