profile
viewpoint
David Chambers davidchambers Berlin https://davidchambers.me Functional programming enthusiast. Creator of Sanctuary, our refuge from unsafe JavaScript.

davidchambers/Base64.js 427

Polyfill for browsers that don't provide window.btoa and window.atob

davidchambers/doctest 143

Doctests for JavaScript (and CoffeeScript)

davidchambers/an.hour.ago 71

A small utility which enables wonderfully expressive date and time manipulation in JavaScript

davidchambers/airwaves 26

Broadcast on a dedicated frequency

davidchambers/CANON 12

Canonical object notation

davidchambers/contenteditable 2

A jQuery utility which adds useful behaviour to `contenteditable` text

davidchambers/cube 2

Magic: The Gathering Cube

davidchambers/deedpoll 2

:page_facing_up: Flag incorrectly named identifiers in JavaScript programs

davidchambers/cheerio 1

Fast, flexible, and lean implementation of core jQuery designed specifically for the server.

fork perezd/PingQoS

UE4 plugin pings QoS beacons of PlayFab

fork in 9 hours

startedgwern/gwern.net

started time in 15 hours

startedMI2CAST/MI2CAST

started time in 16 hours

push eventClojureBridge/clojurebridge.github.io

clojurebridge-machine

commit sha 4f5ff8abc6b524262bdf7f8f0fc9b6e67d8130f3

2020-11-23 update

view details

push time in 20 hours

startedShopify/quilt

started time in a day

fork KenanY/simc

Simulationcraft engine/GUI

fork in a day

startedkoka-lang/koka

started time in a day

pull request commentdavidchambers/doctest

support ES2020 syntax

heh, Travis is failing on Node < 14 (not supporting this new syntax of course), which is both logical but unexpected at the same tile ... :)

EricLanduyt

comment created time in 2 days

PR opened davidchambers/doctest

support ES2020 syntax

New ES2020 operators such as optional chaining or nullish coalescing are not supported:

({})?.x
({}) ?? x

I also had to update Acorn >= 8.x because 7.3.x was looping indefinitely with ecmaScript: "latest" (fixed in https://github.com/acornjs/acorn/issues/981 ).

Alternatives would be to only force es: 2020 in place of "latest" and ideally adding an additional command line flag, but JavaScript being hopefully backward compatible :) , I think "latest" would be more practical on the long term for most users.

+30 -3

0 comment

5 changed files

pr created time in 2 days

fork EricLanduyt/doctest

Doctests for JavaScript (and CoffeeScript)

fork in 2 days

startedboo1ean/casual

started time in 2 days

startedfdw/rofimoji

started time in 3 days

PR opened purescript/purescript-strings

add dotAll regexp flag

This flag is useful especially when it's used with replace function. Let's say we have a big string that contains html and we want to extract the title from it. If we have dotAll regexp flag, we can write the code like this:

replace (unsafeRegex "^.*<title>([^<]+)</title>.*$" dotAll) "$1" bigString It's quite quick and simple. With this, we can remove unneeded parts over multiple lines. This flag is supported by ES2018 and currently, node.js and browsers other than Internet Explorer and Firefox for Android cover that.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/dotAll

+26 -1

0 comment

4 changed files

pr created time in 3 days

PR closed purescript/purescript-strings

add dotAll regexp flag

This flag is useful especially when it's used with replace function. Let's say we have a big string that contains html and we want to extract the title from it. If we have dotAll regexp flag, we can write the code like this:

replace (unsafeRegex "^.*<title>([^<]+)</title>.*$" dotAll) "$1" bigString It's quite quick and simple. With this, we can remove unneeded parts over multiple lines. This flag is supported by ES2018 and currently, node.js and browsers other than Internet Explorer and Firefox for Android cover that.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/dotAll

+26 -1

0 comment

4 changed files

fujisawa

pr closed time in 3 days

PullRequestEvent

PR closed purescript/purescript-strings

add dotAll regexp flag

This flag is useful especially when it's used with replace function. Let's say we have a big string that contains html and we want to extract the title from it. If we have dotAll regexp flag, we can write the code like this:

replace (unsafeRegex "^.*<title>([^<]+)</title>.*$" dotAll) "$1" bigString It's quite quick and simple. With this, we can remove unneeded parts over multiple lines. This flag is supported by ES2018 and currently, node.js and browsers other than Internet Explorer and Firefox for Android cover that.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/dotAll

+26 -1

0 comment

4 changed files

fujisawa

pr closed time in 3 days

starteddkopko/klox

started time in 3 days

startedlocomotivemtl/locomotive-scroll

started time in 4 days

startedappbaseio/searchbox

started time in 4 days

startedmishamyrt/Lilex

started time in 4 days

push eventClojureBridge/clojurebridge.github.io

clojurebridge-machine

commit sha 9b4a398a29fb6953d6df44471ba74a6397485fe1

2020-11-20 update

view details

push time in 4 days

push eventpurescript/purescript-strings

toastal

commit sha 176633dc6d540b7ec279d970ead65b2ce2c734aa

Fix line endings and formatting to match project (#132)

view details

push time in 4 days

PR merged purescript/purescript-strings

Linux line endings & formatting to match project

Since I'm salty about #129 closing #128, here's the switch to Linux line ending and formatting to match the rest of this project that was missing from that pull request

+14 -15

0 comment

1 changed file

toastal

pr closed time in 4 days

Pull request review commentpurescript/purescript-strings

Use coerce instead of unsafeCoerce where appropriate

 import Prim.TypeError as TE import Unsafe.Coerce (unsafeCoerce)  -- | A string that is known not to be empty.-newtype NonEmptyString = NonEmptyString String+newtype NonEmptyString =+  -- | You can use this constructor to create a NonEmptyString that isn't+  -- | non-empty, breaking the guarantee behind this newtype. It is+  -- | provided as an escape hatch mainly for the `Data.NonEmpty.CodeUnits`+  -- | and `Data.NonEmpty.CodePoints` modules. Usage of this constructor+  -- | in your own code provides the same safety guarantees of

Yeah, that sounds good to me.

JordanMartinez

comment created time in 4 days

Pull request review commentpurescript/purescript-strings

Use coerce instead of unsafeCoerce where appropriate

 import Prim.TypeError as TE import Unsafe.Coerce (unsafeCoerce)  -- | A string that is known not to be empty.-newtype NonEmptyString = NonEmptyString String+newtype NonEmptyString =+  -- | You can use this constructor to create a NonEmptyString that isn't

*NonEmptyString (with backticks)?

JordanMartinez

comment created time in 4 days

pull request commentpurescript/purescript-strings

Use coerce instead of unsafeCoerce where appropriate

I did the following in https://github.com/purescript/purescript-arrays/pull/184:

Capture d’écran 2020-11-19 à 23 52 42

JordanMartinez

comment created time in 4 days

Pull request review commentpurescript/purescript-strings

Use coerce instead of unsafeCoerce where appropriate

 import Prim.TypeError as TE import Unsafe.Coerce (unsafeCoerce)  -- | A string that is known not to be empty.-newtype NonEmptyString = NonEmptyString String+newtype NonEmptyString =+  -- | You can use this constructor to create a NonEmptyString that isn't+  -- | non-empty, breaking the guarantee behind this newtype. It is+  -- | provided as an escape hatch mainly for the `Data.NonEmpty.CodeUnits`+  -- | and `Data.NonEmpty.CodePoints` modules. Usage of this constructor+  -- | in your own code provides the same safety guarantees of

Can’t we just remove this sentence? The first one already mention that usage of this constructor breaks the newtype guarantees.

JordanMartinez

comment created time in 4 days

starteddavidchambers/doctest

started time in 5 days

starteddashersw/cote

started time in 5 days

more