Install: npm i tiny-array-flat-polyfill
import 'tiny-array-flat-polyfill';
const ARR = [1, [2, [3]], [[[4]]], 5]
// Y Combinator | |
const Y = a => (b => b (b)) (b => a (c => b (b) (c))) | |
// isomorphic Church encoding/decoding | |
const Church = { | |
to: n => f => x => Array.from (Array (n)).reduce (f, x), | |
from: f => f (x => x + 1) (0) | |
} | |
const True = a => b => a |
// S and K are primitive function combinators. | |
const S = a => b => c => a (c) (b (c)) | |
const K = a => b => a | |
// Non-primitive combinators can be created with S and K. | |
const C = S (S (K (S (K (S)) (K))) (S)) (K (K)) | |
const I = S (K) (K) | |
const KI = K (I) | |
const M = S (I) (I) | |
const R = S (K (S (K (S)) (K))) (S (K (S (I))) (K)) |
// Tracking cursor position in real-time without JavaScript | |
// Demo: https://twitter.com/davywtf/status/1124146339259002881 | |
package main | |
import ( | |
"fmt" | |
"net/http" | |
"strings" | |
) |
'use strict'; | |
const stateMap = new WeakMap(); | |
function useState(key, init) { | |
const update = (v) => stateMap.set(key, v); | |
if (stateMap.has(key)) { | |
return [stateMap.get(key), update]; | |
} | |
stateMap.set(key, init); | |
return [init, update]; |
Hey everyone - this is not just a one off thing, there are likely to be many other modules in your dependency trees that are now a burden to their authors. I didn't create this code for altruistic motivations, I created it for fun. I was learning, and learning is fun. I gave it away because it was easy to do so, and because sharing helps learning too. I think most of the small modules on npm were created for reasons like this. However, that was a long time ago. I've since moved on from this module and moved on from that thing too and in the process of moving on from that as well. I've written way better modules than this, the internet just hasn't fully caught up.
@broros
otherwise why would he hand over a popular package to a stranger?
If it's not fun anymore, you get literally nothing from maintaining a popular package.
One time, I was working as a dishwasher in a restu
So, I was reading Why You shouldn’t use lodash anymore and use pure JavaScript instead, because once upon a time, I shifted from Underscore to Lodash, and I'm always on the lookout for the bestest JavaScript stdlib. At the same time, there was recently an interesting conversation on Twitter about how some of React's functionality can be easily implemented in modern vanilla JS. The code that came out of that was elegant and impressive, and so I have taken that as a message to ask if we really need the framework.
Unfortunately, it didn't start out well. After copy-pasting the ~100 lines of code that Lodash executes to perform a
find, there was then this shocking claim:
.
This post by a security researcher who prefers to remain anonymous will elucidate concerns about certain problematic decisions Apple has made and caution about future decisions made in the name of “security” while potentially hiding questionable motives. The content of this article represents only the opinion of the researcher. The researcher apologises if any content is seen to be inaccurate, and is open to comments or questions through PGP-encrypted mail.
TL;DR
In this tutorial, I will be explaining how to set up a simple webhook to relay your tweets to a Discord channel