Combine default parameters and destructuring for a compact version of the defaults / overrides pattern.
function foo ({
bar = 'no',
baz = 'works!'
} = {}) {
import sublime, sublime_plugin | |
BLOCKLEN = 4 | |
class TypeFileOutCommand(sublime_plugin.TextCommand): | |
def nextchar(self): | |
if self.body: | |
totype = [] | |
while 1: | |
try: |
(function(){ | |
var log = console.log; | |
console.log = function(str) { | |
var css = 'background: linear-gradient(to right, red, yellow, lime, aqua, blue, fuchsia, red); color: white; font-weight: bold;'; | |
var args = Array.prototype.slice.call(arguments); | |
args[0] = '%c' + args[0]; | |
args.splice(1,0,css); | |
var speech = new SpeechSynthesisUtterance(); |
/** | |
* Blueprint background SVG | |
*/ | |
min-height: 100%; | |
background: #004890 url('data:image/svg+xml;,<svg xmlns="http://www.w3.org/2000/svg" fill="%23fff"><pattern id="a" width="20" height="20" patternUnits="userSpaceOnUse" patternTransform="rotate(65)"><path d="M10 0v9h9v1h-9v9h-1v-9h-9v-1h9v-9" opacity=".08"/><path d="M0 19h19v-19h1v20h-20" opacity=".15"/></pattern><rect width="100%" height="100%" fill="%23004890"/><rect width="100%" height="100%" fill="url(%23a)"/></svg>'); |
function swtch(value, cases) { | |
return cases[value]; | |
} | |
var foo = 3; | |
console.log( | |
swtch(foo, { | |
1: "one", | |
2: "two", |
import React from 'react'; | |
import services from '../services/index'; | |
import BigCalendar from 'react-big-calendar'; | |
import moment from 'moment'; | |
import 'react-big-calendar/lib/css/react-big-calendar.css'; | |
// setting to use Saturday as the first day of the week | |
moment.updateLocale('en-gb', { | |
week : { |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://cdn.jsdelivr.net/npm/core-js@latest/client/shim.min.js"></script> | |
<script src="https://wzrd.in/standalone/tape@latest"></script> | |
<script src="https://wzrd.in/standalone/tap-browser-color@latest"></script> | |
<script src="//fb.me/react-dom@latest"></script> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> |
$ sudo npm install -g hexo-cli
$ hexo -v
hexo-cli: 0.1.9
CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control
and E-Tag
headers, etc.), minification, etc.
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Mocha Tests</title> | |
<link href="https://cdnjs.cloudflare.com/ajax/libs/mocha/5.0.0/mocha.css" rel="stylesheet" /> | |
</head> | |
<body> | |
<div id="mocha"></div> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/5.0.0/mocha.js"></script> |