I hereby claim:
- I am jczimm on github.
- I am jczimm (https://keybase.io/jczimm) on keybase.
- I have a public key whose fingerprint is F12C FDA4 2608 B5F4 7582 0D1B DFB5 382A 5D4D E45C
To claim this, I am signing this object:
function rotate_point(pointX, pointY, originX, originY, angle) { | |
angle = angle * Math.PI / 180.0; | |
return [ | |
Math.cos(angle) * (pointX-originX) - Math.sin(angle) * (pointY-originY) + originX, | |
Math.sin(angle) * (pointX-originX) + Math.cos(angle) * (pointY-originY) + originY | |
]; | |
} |
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<polymer-element name="my-element"> |
I hereby claim:
To claim this, I am signing this object:
function Chain (datum) { | |
if (datum != undefined) { | |
this.length = this.length !== undefined ? this.length + 1 : 1; | |
this[this.length - 1] = datum; | |
return Chain.bind(this); | |
} else { | |
return this; | |
} |
var charMap = function charMap(str, from, to, tryLowerCase = false) { | |
return str | |
.split("") | |
.map((char, i) => to.charAt(from.indexOf(tryLowerCase ? char.toLowerCase() : char)) || char) | |
.join(""); | |
}; | |
var normal = "abcdefghijklmnopqrstuvwxyz", | |
smallLetters = "\u1d00\u0299\u1d04\u1d05\u1d07\u0493\u0262\u029c\u026a\u1d0a\u1d0b\u029f\u1d0d\u0274\u1d0f\u1d18\u01eb\u0280s\u1d1b\u1d1c\u1d20\u1d21x\u028f\u1d22"; |
// Syntax 1: | |
s.val(13)::third::second::first::s.run(); | |
// Syntax 2: (-> s.val completely unnecessary) | |
third::second::first::s.run(13); | |
// | |
// Example programmatic creation of a chain | |
let chain = third; |
module['exports'] = function jczimmCLI (hook) { | |
var request = require('request'); | |
var http = require('http') | |
, vm = require('vm') | |
, concat = require('concat-stream'); | |
request.get("https://npmcdn.com/hget@3.0.0/index.js", function(err, res, body) { | |
var sandbox = { require: require }; | |
vm.createContext(sandbox); | |
vm.runInThisContext(body, './remote_modules/hget.js', sandbox); | |
var hget = require('./remote_modules/hget.js'); |
const a4Freq = 440; | |
const noteNames = ["A", "A#", "B", "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#"]; | |
function noteToFrequency(noteName) { | |
const [, noteLetter, octaveNum] = noteName.match(/^(\w#?)(\d)$/) || []; | |
const numStepsFromA = noteNames.indexOf(noteLetter.toUpperCase()); | |
if (numStepsFromA === -1 || !noteLetter) return new Error("Invalid note"); | |
const numStepsFromMiddleA = numStepsFromA + 12 * (octaveNum - 4); | |
const choo = require('choo') | |
const app = choo() | |
app.model({ | |
// namespace: "app", | |
state: { title: 'Set the title' }, | |
reducers: { | |
update: (action, state) => ({ title: action.value }) | |
} | |
}) |
const toHexCharCode = char => char.charCodeAt(0).toString(16).padStart(2, '0'); | |
function encodeGolf(plain) { | |
return unescape( // enter unicode escape codes land | |
plain.match(/[\s\S]{1,2}/g) // split string into pairs of letters | |
.map(([a, b]) => b ? '%uD8' + toHexCharCode(a) + '%uDC' + toHexCharCode(b) : a) // encode each pair as a high surrogate and low surrogate in unicode (where an odd character, just include it unencoded to preserve odd length) | |
.join('') // concatenate the escape codes as a string | |
); // exit escape codes land; return actual unicode characters | |
} | |
// 5 bytes fewer than decode |