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
function* pascalsTriangleRow(row) { | |
let prev = 1; | |
for(let i = 1; i <= row; ++i) { | |
yield prev; | |
prev = (prev * (row - (i - 1))) / i; | |
} | |
yield 1; | |
} | |
Array.from(pascalsTriangleRow(19)); |
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
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]; | |
} |
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
require 'etsy' | |
Etsy.api_key = '<api-key>' | |
shop = Etsy::Shop.find '<shop-name>' | |
out_dir = '<output-directory>' | |
Etsy.environment = :production | |
Dir.mkdir out_dir unless File.exists? out_dir | |
listings = [] |
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
Function.prototype.once = function () { | |
let fn = this; | |
let called = false; | |
return function() { | |
if (!called) { | |
called = true; | |
return fn.apply(this, arguments); | |
} | |
}; | |
}; |
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
Copyright (c) 2011, Michael Ficarra | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright notice, this | |
list of conditions and the following disclaimer. | |
* Redistributions in binary form must reproduce the above copyright notice, | |
this list of conditions and the following disclaimer in the documentation | |
and/or other materials provided with the distribution. |
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
const safeApply = Date.call.bind(Date.apply); | |
const randomName = () => Math.random().toString(36).slice(2).toLowerCase(); | |
class RevokedCapabilityException extends Error {} | |
class Capability { | |
constructor(behaviour, { name = randomName() } = {}) { | |
this.behaviour = behaviour; | |
this.name = Object.freeze([].concat(name)); | |
} |
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
module Main where | |
--data Language = English | Spanish | |
--data Censored = Censored | NotCensored | |
--data Encoding = Plain | EncodingA | EncodingB | |
data English | |
data Spanish | |
data Censored |
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
// https://github.com/michaelficarra/ecmascript-interfaces-proposal | |
interface HasHashCode { | |
hashCode; | |
} | |
class SetUsingHashCode extends Set { | |
constructor(iterable) { | |
super(); | |
this.#map = new Map; | |
for (let x of iterable) { |
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
diff --git c/purescript.cabal i/purescript.cabal | |
index 4f4fcabd..699e8440 100644 | |
--- c/purescript.cabal | |
+++ i/purescript.cabal | |
@@ -231,6 +231,7 @@ library | |
Language.PureScript.Sugar.TypeClasses | |
Language.PureScript.Sugar.TypeClasses.Deriving | |
Language.PureScript.Sugar.TypeDeclarations | |
+ Language.PureScript.Terms | |
Language.PureScript.Traversals |
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
commit e6284b9bd6977ca282bdf13d13fab4d8bf6be71b | |
Normative: Add [?Yield] to PropertyName in AssignmentProperty | |
commit f0ef98ae9ecdfd1ed1e14721e795f6188a3107ee | |
Normative: Fix yield * semantics when calling .throw | |
commit 6ba35eb8fb9aad699efdd1766c52bc9f6401d039 | |
Normative: update Annex B regexp grammar | |
commit d96e60a99a40fab2de0df329b3e5445ac27b8a8e | |
Normative: Remove [[Enumerate]] and associated reflective capabilities | |
commit 24dad16327b7cbbdf67805e45e58c54abe558f63 | |
Normative: Require Unicode 8.0.0 |
NewerOlder