Skip to content

Instantly share code, notes, and snippets.

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>');
@jayrgee
jayrgee / defaults-overrides.md
Created April 24, 2016 22:32 — forked from ericelliott/defaults-overrides.md
ES6 defaults / overrides pattern

ES6 Defaults / Overrides Pattern

Combine default parameters and destructuring for a compact version of the defaults / overrides pattern.

function foo ({
    bar = 'no',
    baz = 'works!'
  } = {}) {
@jayrgee
jayrgee / swtch.js
Created March 8, 2017 04:00 — forked from anonymous/swtch.js
An evaluating switch in JavaScript
function swtch(value, cases) {
return cases[value];
}
var foo = 3;
console.log(
swtch(foo, {
1: "one",
2: "two",
@jayrgee
jayrgee / timesheet.js
Created October 10, 2017 06:05 — forked from stevenkaspar/timesheet.js
react-big-calendar example
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 : {
@jayrgee
jayrgee / jsbin-template.html
Last active January 26, 2018 00:58 — forked from ericelliott/jsbin-template.html
JSBin HTML
<!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>
@jayrgee
jayrgee / useHexo.md
Created February 4, 2018 14:19 — forked from btfak/useHexo.md
How to use Hexo and deploy to GitHub Pages
@jayrgee
jayrgee / HOWTO.md
Created February 9, 2018 00:06 — forked from cvan/HOWTO.md
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default

Instructions

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.

  1. Make sure you have registered a domain name.
  2. Sign up for CloudFlare and create an account for your domain.
  3. In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to this awesome list of links for instructions for various registrars).
  4. From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
  5. If you
@jayrgee
jayrgee / index.html
Last active February 10, 2018 12:08 — forked from NelsonMinar/index.html
Demo of using Mocha + Chai in a browser without Node
<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>