Skip to content

Instantly share code, notes, and snippets.

View destiny0114's full-sized avatar
💣
Never Stop Learning

Keena Levine destiny0114

💣
Never Stop Learning
View GitHub Profile
@destiny0114
destiny0114 / rotation.js
Created December 26, 2024 03:20 — forked from akella/rotation.js
tsl rotation
const rotate2D = Fn(({pos,angle})=>{
const s = sin(angle);
const c = cos(angle);
const m = mat2(c, s, s.mul(-1), c);
return m.mul(pos);
})
const rotate3D = Fn(({pos,axis,angle})=>{
const axisNorm = normalize(axis);
const s = sin(angle);
@destiny0114
destiny0114 / GLSL-Noise.md
Created October 17, 2024 02:05 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@destiny0114
destiny0114 / oklab.glsl
Created October 6, 2024 08:57 — forked from akella/oklab.glsl
oklab.glsl
float fixedpow(float a, float x)
{
return pow(abs(a), x) * sign(a);
}
float cbrt(float a)
{
return fixedpow(a, 0.3333333333);
}
@destiny0114
destiny0114 / curl.glsl
Created October 6, 2024 08:57 — forked from akella/curl.glsl
curl.glsl
#define PI 3.1415926538
const float EPS = 0.001;
vec4 mod289(vec4 x) {
return x - floor(x * (1.0 / 289.0)) * 289.0;
}
float mod289(float x) {
return x - floor(x * (1.0 / 289.0)) * 289.0;
}
vec4 permute(vec4 x) {
@destiny0114
destiny0114 / noise.glsl
Created October 6, 2024 08:57 — forked from akella/noise.glsl
noise.glsl
//
// GLSL textureless classic 3D noise "cnoise",
// with an RSL-style periodic variant "pnoise".
// Author: Stefan Gustavson (stefan.gustavson@liu.se)
// Version: 2011-10-11
//
// Many thanks to Ian McEwan of Ashima Arts for the
// ideas for permutation and gradient selection.
//
// Copyright (c) 2011 Stefan Gustavson. All rights reserved.
@destiny0114
destiny0114 / nodejs-express-cookies-example.js
Created October 8, 2021 09:06 — forked from gdm85/nodejs-express-cookies-example.js
How to create session cookies with Node.js + Express
var express = require('express'),
app = express(),
https = require('https'),
fs = require('fs'),
keys = require( "keygrip" )(['secret1', 'secret2']),
cookies = require( "cookies" );
// This line is from the Node.js HTTPS documentation
var options = {
key: fs.readFileSync('private_key_cert.pem'),
@destiny0114
destiny0114 / ultimate-ut-cheat-sheet.md
Created September 18, 2020 05:38 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@destiny0114
destiny0114 / app.js
Created July 5, 2020 08:40 — forked from joshnuss/app.js
Express.js role-based permissions middleware
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./permission"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection
@destiny0114
destiny0114 / index.md
Created October 3, 2019 05:43 — forked from ericandrewlewis/index.md
C++ Pointer Tutorial

C++ Pointer Tutorial

Because pointers can be ugh

"Regular" variables (not pointers)

To understand a pointer, let's review "regular" variables first. If you're familiar with a programming language without pointers like JavaScript, this is what you think when you hear "variable".

When declaring a variable by identifier (or name), the variable is synonymous with its value.

@destiny0114
destiny0114 / .zshrc
Last active July 24, 2022 09:21 — forked from XEngine/.zshrc
ZSH Config
export PATH=/opt/homebrew/bin:$PATH
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,