Skip to content

Instantly share code, notes, and snippets.

View hexagon6's full-sized avatar

hexagon6

View GitHub Profile
@hexagon6
hexagon6 / collatz.rs
Last active August 7, 2021 14:59 — forked from rust-play/playground.rs
recursive collatz in rust
fn collatz(num: i64, list: &mut Vec<i64>) {
let exists: bool = list.contains(&num);
match exists {
true => {}
false => {
list.push(num);
let even: bool = num % 2 == 0;
match even {
true => collatz(num / 2, list),
false => collatz(3 * num + 1, list),
@sindresorhus
sindresorhus / esm-package.md
Last active June 19, 2024 03:43
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@WebReflection
WebReflection / dom-libraries.md
Last active February 6, 2024 15:50
A recap of my FE / DOM related libraries

My FE/DOM Libraries

a gist to recap the current status, also available as library picker!

Minimalistic Libraries

do one thing only and do it well

  • µhtml (HTML/SVG auto-keyed and manual keyed render)
  • augmentor (hooks for anything)
  • wickedElements (custom elements without custom elements ... wait, what?)
@scottjbarr
scottjbarr / compiler-music.sh
Created December 7, 2018 06:29
Generate music from code, and gcc
#!/bin/bash
#
# Generate music from code and gcc.
#
# This actually sounds pretty good!
#
# I am not the original author of this code, it was tweeted by
# @kr094_ . See https://twitter.com/kr094_/status/928038531125207040
#
# Author : Scott Barr

Remove a large file from previous git commit / GitHub

E.g. when accidentally committing a large file to a git repo and GitHub refises the commit.

git filter-branch --tree-filter 'rm -f path/to/large/file' HEAD

Afterwards, simply try to push to GitHub again...

@bvaughn
bvaughn / index.md
Last active April 3, 2024 07:41
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.

@sergmetelin
sergmetelin / hackathon_how_to.md
Last active July 21, 2020 04:03
Hackathon Getting Started guide

About EOSIO

The EOS.IO software introduces a new blockchain architecture designed to enable vertical and horizontal scaling of decentralized applications. This is achieved by creating an operating system-like construct upon which applications can be built. The software provides accounts, authentication, databases, asynchronous communication and the scheduling of applications across many CPU cores or clusters. The resulting technology is a blockchain architecture that may ultimately scale to millions of transactions per second, eliminates user fees, and allows for quick and easy deployment and maintenance of decentralized applications, in the context of a governed blockchain.

About this guide:

Full documentation can be found at https://developers.eos.io/

This means your portal is correctly setup for the hackathon.

@gaearon
gaearon / prepack-gentle-intro-1.md
Last active May 3, 2024 12:56
A Gentle Introduction to Prepack, Part 1

Note:

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.
@ceejbot
ceejbot / esm_in_node_proposal.md
Last active July 17, 2023 02:45
npm's proposal for supporting ES modules in node

ESM modules in node: npm edition

The proposal you’re about to read is not just a proposal. We have a working implementation of almost everything we discussed here. We encourage you to checkout and build our branch: our fork, with the relevant branch selected. Building and using the implementation will give you a better understanding of what using it as a developer is like.

Our implementation ended up differing from the proposal on some minor points. As our last action item before making a PR, we’re writing documentation on what we did. While I loathe pointing to tests in lieu of documentation, they will be helpful until we complete writing docs: the unit tests.

This repo also contains a bundled version of npm that has a new command, asset. You can read the documentation for and goals of that comma

@rockhymas
rockhymas / minecraftseeds.txt
Last active May 5, 2020 02:47
Minecraft seeds that generate all biomes within 5000 blocks
Over the last year or so, I've been using MineAtlas to compile a nice long list of seeds that have all biomes within 5000 blocks.
Specifically, I looked to make sure each seed has ice spikes, jungle, mega taiga, mushroom island, and mesa biomes within 5000
blocks of 0, 0. I do this so that when I want to start a new world, I can pick one of these, trusting that it
will be a good world to explore, but without having just seen a map. That way I don't know where everything is, just that it's all
close enough to make it worth it.
243091048059118
-828131664763204
-761676406782751
-376708943228782