Skip to content

Instantly share code, notes, and snippets.

View jaronwanderley's full-sized avatar

Jaron Wanderley jaronwanderley

View GitHub Profile
@william-silversmith
william-silversmith / sigmoidfactory.js
Last active October 26, 2021 12:15
An ease-in-out curve that has customizable steepness.
/* sigmoidFactory
*
* Generate an ease-in-out function with desired steepness.
* Accompanying article: https://medium.com/analytic-animations/ease-in-out-the-sigmoid-factory-c5116d8abce9
*
* Required:
* k: (float != 0), sharpness of ease
*
* Return: f(t), t in 0..1
*/
@william-silversmith
william-silversmith / springfactory.js
Last active August 25, 2023 12:24
Spring Factory
/* springFactory
*
* Generate a physically realistic easing curve for a damped mass-spring system.
*
* Required:
* damping (zeta): [0, 1)
* halfcycles: 0...inf
*
* Optional:
* initial_position: -1..1, default 1
@paiv
paiv / mathcalc.js
Last active October 29, 2023 11:13
Expression parser in JavaScript
//
// MathCalc: a parser for basic mathematical expressions
// From here: https://paiv.github.io/blog/2016/03/23/js-calc.html
//
//
// Copyright (c) 2016, Pavel Ivashkov, github.com/paiv
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
@blahah
blahah / README.md
Created April 17, 2016 07:34
Comparison of embedded NoSQL databases that can be emedded in a Node.js - Electron app

Making an Electron app and want to embed a database? Here's a table to help you choose the right database software.

Work in progress

Project Language NPM package? Flat file? In memory? Full-text search? Maturity Embedded size Dependencies
NeDB Javascript Yes Always No High Low Simple
Lunr Javascript No Yes Yes High Tiny None
Search-index Javascript
Sqlite3 C Yes No Yes (fts extens
@fschr
fschr / main.cpp
Last active September 30, 2025 19:32
SDL2 Hello World | SDL2 Getting Started | SDL | OpenGL
// SDL2 Hello, World!
// This should display a white screen for 2 seconds
// compile with: clang++ main.cpp -o hello_sdl2 -lSDL2
// run with: ./hello_sdl2
#include <SDL2/SDL.h>
#include <stdio.h>
#define SCREEN_WIDTH 640
#define SCREEN_HEIGHT 480
@peduarte
peduarte / esnextbin.md
Last active August 25, 2022 14:55
Vanilla Debounce
@oubiwann
oubiwann / appify.sh
Last active April 19, 2025 14:45 — forked from advorak/appify.sh
appify — create the simplest possible Mac app from a shell script (adds an application icon)
#!/usr/bin/env bash
VERSION=4.0.1
SCRIPT=`basename "$0"`
APPNAME="My App"
APPICONS="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns"
OSX_VERSION=`sw_vers -productVersion`
PWD=`pwd`
function usage {
@lehni
lehni / index.html
Last active December 25, 2023 10:49
Paper.js Bézier Offsetting
<!DOCTYPE html>
<html>
<head>
<!--
Copyright (c) 2014-2017, Jan Bösenberg & Jürg Lehni
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@ccnokes
ccnokes / vanilla-online-offline.js
Last active September 22, 2020 02:35
Online/offline emitter in vanilla JS
function createOnlineEmitter() {
let cbs = []; //array of registered callbacks for the event
let unsub; //function for removing the main event listener
//this is the main event listener that gets registered with window.online/offline event
const mainListener = (isOnline) => {
//call all the subscribed callbacks
cbs.forEach(cb => cb(isOnline));
};
@pbeshai
pbeshai / .block
Last active May 25, 2022 17:34
Compute points and angles along a bezier curve
license: mit
height: 320
border: no