Skip to content

Instantly share code, notes, and snippets.

(ू˃̣̣̣̣̣̣︿˂̣̣̣̣̣̣ ू)

Luke Hedger lukehedger

(ू˃̣̣̣̣̣̣︿˂̣̣̣̣̣̣ ू)
View GitHub Profile
pfeilbr / index.jsx
Created September 12, 2020 12:17
react tsx/jsk cdk app
View index.jsx
// pseudocode
const { ReactCDK, App, Stack } = require('@aws-cdk/react')
const Bucket = require('@aws-cdk/react/s3')
const { CloudFrontDistribution, Origins, DefaultOrigin } = require('@aws-cdk/react/cloudfront')
const { Api, Resource, Integration } = require('@aws-cdk/react/apigateway')
const Lambda = require('@aws-cdk/react/lambda')
const EchoLambda = (
dominictarr /
Created November 26, 2018 22:39
statement on event-stream compromise

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.


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

bvaughn /
Last active February 28, 2023 23:31
Interaction tracing with React

This API was removed in React 17

Interaction tracing with React

React recently introduced an experimental profiler API. After discussing this API with several teams at Facebook, one common piece of feedback was that the performance information would be more useful if it could be associated with the events that caused the application to render (e.g. button click, XHR response). Tracing these events (or "interactions") would enable more powerful tooling to be built around the timing information, capable of answering questions like "What caused this really slow commit?" or "How long does it typically take for this interaction to update the DOM?".

With version 16.4.3, React added experimental support for this tracing by way of a new NPM package, scheduler. However the public API for this package is not yet finalized and will likely change with upcoming minor releases, so it should be used with caution.

gaearon /
Last active May 14, 2023 18:54
A Gentle Introduction to Prepack, Part 1


When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
trueadm / adopt-syntax.js
Last active November 27, 2021 03:32
Adding a the "adopt" keyword to the JSX syntax
View adopt-syntax.js
// I'm suggesting we add a new "adopt X from <Y />" syntax to the JSX language
// it would de-sugar to render prop children, but look and read better than
// what we currently have. For example:
// 1.
// this sugar
function MyComponent(props) {
adopt foo from <Bar />;
return <div>{foo}</div>;
webbower / shuffle-durstenfeld.js
Created December 2, 2017 22:02
Durstenfeld shuffle
View shuffle-durstenfeld.js
// Pre-ES6
* Randomize array element order in-place.
* Using Durstenfeld shuffle algorithm.
function shuffleArray(array) {
for (var i = array.length - 1; i > 0; i--) {
anonymous / HelloYou.sol
Created November 23, 2017 15:48
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at
View HelloYou.sol
pragma solidity ^0.4.18;
// import './SomeContract.sol';
contract HelloYou {
event Hello(address you);
function sayHello() public {
address _person = msg.sender;
developit / *
Last active February 6, 2021 00:44
265b lib for building pure functional state machine components.
View *


A tiny (265 byte) utility to create state machine components using two pure functions.

🔥 JSFiddle Demo


The API is a single function that accepts 2 pure functions as arguments:

Geoff-Ford /
Last active May 25, 2023 03:30
Eric Elliott's Master the JavaScript Interview Series
nolash / gist:62e6c872ec126594359d20cbe26cd3aa
Last active September 6, 2020 21:46
solidity contract disassembly interpretation
View gist:62e6c872ec126594359d20cbe26cd3aa


pragma solidity ^0.4.11;

contract Simple {
	bytes32 public v;
	function set(bytes32 _v) {
		v = _v;