In this tutorial we're going to build a set of parser combinators.
We'll answer the above question in 2 steps.
- What is a parser?
- and, what is a parser combinator?
So first question: What is parser?
Old School:
var clean = function (input) {
var testMe = input, dupeTest = '';
while (testMe !== dupeTest) {
testMe = new DOMParser().parseFromString(testMe, "text/html").documentElement.textContent;
dupeTest = testMe;
}
testMe = testMe.replace(/</g, '<');
return testMe;
/** | |
* @desc Basic linear value animation that can accept simple easing functions and provides update & complete callbacks | |
* @param {Object} values - Object with numerical values. eg. { value1: 0, value2: 20, someKey: 55 } | |
* @param {Number} duration - How long (in milliseconds) the animation will be | |
* @param {Object} options - target values, update callback & complete callback | |
* @param {Function} [options.onComplete=(values) => values] - Callback that fires once animation is complete | |
* @param {Function} [options.onUpdate=(values) => values] - Callback that fires when animation frame updates | |
* @param {Function} [options.ease=(t) => t] - easing method eg. https://gist.github.com/gre/1650294 | |
* @example | |
* |
#!/bin/bash | |
echo "\n\n--- Killing Stupid Adobe Auto Load Crap ---\n\n" | |
launchctl unload -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist | |
launchctl unload -w /Library/LaunchAgents/com.adobe.AAM.Updater-1.0.plist | |
echo "\n\n--- Done! ---\n\n" |
import React from 'react'; | |
const MIN_SCALE = 1; | |
const MAX_SCALE = 4; | |
const SETTLE_RANGE = 0.001; | |
const ADDITIONAL_LIMIT = 0.2; | |
const DOUBLE_TAP_THRESHOLD = 300; | |
const ANIMATION_SPEED = 0.04; | |
const RESET_ANIMATION_SPEED = 0.08; | |
const INITIAL_X = 0; |
.alignment--left { | |
.public-DraftStyleDefault-block { | |
text-align; left; | |
} | |
} | |
.alignment--center { | |
.public-DraftStyleDefault-block { | |
text-align; center; | |
} | |
} |
/* @flow */ | |
import * as I from "immutable"; | |
/** | |
* Define an immutable record intended for holding reducer state | |
* @param spec - the keys and their default values | |
* @return a state record factory function | |
*/ | |
export function defineRecord<T: Object>( |
function append(separator) { | |
return typeof separator === "string" ? appender(separator, "") : appender("", "").apply(this, arguments); | |
} | |
function appender(separator, s) { | |
return function tag(literalParts, ...computedParts) { | |
s += literalParts[0]; | |
for (let i = 1; i < literalParts.length; ++i) { | |
s += computedParts[i - 1] + literalParts[i]; | |
} |
var Promise = require('bluebird'); | |
var funcs = Promise.resolve([500, 100, 400, 200].map((n) => makeWait(n))); | |
funcs | |
.each(iterator) // logs: 500, 100, 400, 200 | |
.then(console.log) // logs: [ [Function], [Function], [Function], [Function] ] | |
funcs | |
.mapSeries(iterator) // logs: 500, 100, 400, 200 |
extension_id=jifpbeccnghkjeaalbbjmodiffmgedin # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc"
unzip -d "$extension_id-source" "$extension_id.zip"
Thx to crxviewer for the magic download URL.