Skip to content

Instantly share code, notes, and snippets.

View autonome's full-sized avatar

Dietrich Ayala autonome

View GitHub Profile
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 3, 2024 13:01
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@tophtucker
tophtucker / README.md
Last active April 22, 2024 16:01
Beginning to reverse-engineer FizzyText

TOTALLY SUPER DUPER NOT MY WORK! Trying to illuminate how FizzyText (seen here, source here, isolated from dat.GUI dependency here) works. Original appears to have been written by George Michael Brower.

In the original, which I find brilliant:

  • Solid black text is drawn onto an invisible canvas, from which it gets bitmap data
  • The bitmap data is read like a collision detection array, where black means "you're on top of text" and white means "you're not"
  • Particles of size r=0 are randomly spawned on a visible canvas
  • The particles grow if they're on top of a (non-rendered) black pixel, and shrink till they disappear if not
  • When they shrink to r=0, they respawn randomly somewhere
  • The particles follow a Perlin noise flow field, a very sensible and fluid kind of random movement, in which nearby particles
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 16:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@gsaslis
gsaslis / 01_Radicle_in_containers.md
Last active March 28, 2024 11:30
Running Radicle Nodes in Containers

Running in Containers

In case you want to run radicle in containers, on the same host (e.g. your laptop), you can use the docker-compose.yml file provided within this repo.

1. Create a profile

  1. Create a folder where you will store the data of your node. e.g. mkdir -p ~/radicle/profiles/bob/.radicle
  2. Set RAD_HOME : export RAD_HOME=~/radicle/profiles/bob/.radicle
  3. Create a key:
  • Pick a good passphrase and store it in your password manager
@Nemo157
Nemo157 / _Publishing crates to IPFS.md
Last active March 26, 2024 20:46
Publishing crates to IPFS

Publishing crates to IPFS

This was an experiment in seeing how feasible it would be to distribute crates on IPFS using the alternative registries feature combined with a local IPFS web gateway.

There was very little plan for this originally, and I wish I had kept more of the intermediate states as I went through multiple major design changes. My original goal was to publish my CLI utility [bs58-cli][] and its dependency tree.

@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active February 12, 2024 17:18
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@tobyjsullivan
tobyjsullivan / abbreviateNum.js
Created May 31, 2017 00:57
Abbreviate large numbers in Javascript
// Iterated from: https://stackoverflow.com/questions/10599933/convert-long-number-into-abbreviated-string-in-javascript-with-a-special-shortn
function abbreviateNumber(value) {
let newValue = value;
const suffixes = ["", "K", "M", "B","T"];
let suffixNum = 0;
while (newValue >= 1000) {
newValue /= 1000;
suffixNum++;
}
@banksean
banksean / perlin-noise-classical.js
Created February 15, 2010 10:00
two Perlin noise generators in javascript. The simplex version is about 10% faster (in Chrome at least, haven't tried other browsers)
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/
@anvk
anvk / promises_reduce.js
Last active October 11, 2023 09:02
Sequential execution of Promises using reduce()
function asyncFunc(e) {
return new Promise((resolve, reject) => {
setTimeout(() => resolve(e), e * 1000);
});
}
const arr = [1, 2, 3];
let final = [];
function workMyCollection(arr) {