const someArray = ['foo', 'bar']
const someOtherArray = ['foobar', 'barfoos']
const config = [
...someArray,
...someOtherArray,
{
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See https://www.youtube.com/watch?v=D1a8OoBWi1g&list=PLIvujZeVDLMx040-j1W4WFs1BxuTGdI_b&index=10 | |
function compose(...args: any[]) { | |
return {} as any; | |
} | |
const addOne = (a: number) => { | |
return a + 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* supplant() does variable substitution on the string. It scans through the string looking for | |
* expressions enclosed in { } braces. If an expression is found, use it as a key on the object, | |
* and if the key has a string value or number value, it is substituted for the bracket expression | |
* and it repeats. | |
* | |
* Written by Douglas Crockford | |
* http://www.crockford.com/ | |
*/ | |
String.prototype.supplant = function (o) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Parent iframe</title> | |
</head> | |
<body> | |
<h1>Parent iframe</h1> | |
<textarea id="log" width="40" height="30"></textarea> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This is similar to http://php.net/manual/en/function.array-reduce.php but returns | |
* the return from the callback immediately when it is 'truthy'. The callback also | |
* is being passed the 'key' in addition to just the 'value'. So this is basically | |
* some sort of more flexible array_reduce, array_filter and array_search | |
*/ | |
function array_find($array, $callback) { | |
foreach ($array as $key => $value) { | |
$result = $callback($value, $key); | |
if ($result) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paste this for example to the console | |
window.addEventListener(“beforeunload”, function() { debugger; }, false) |
A Pen by Peter Broschwitz on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Debug Unit Tests", | |
"runtimeExecutable": "npm", | |
"runtimeArgs": [ | |
"run-script", |
NewerOlder