Skip to content

Instantly share code, notes, and snippets.

View joceqo's full-sized avatar
💭
I may be slow to respond.

Jocelin joceqo

💭
I may be slow to respond.
  • Lyon
View GitHub Profile
const sessionStorageData = JSON.parse(sessionStorage.getItem("indexSelectedFilters")) || [];
for (let i = 0; i < sessionStorageData.length; i++){
const value = sessionStorageData[i];
const checkbox = document.querySelector(`#${value}`);
if (checkbox) {
checkbox.checked = true;
}
}
let form = document.querySelector('#wf-form-Search-Bar');
let submitButton = document.querySelector('#form-button');
const selectedFilters = sessionStorage.getItem('indexSelectedFilters');
let tempSelectedFilters;
if (selectedFilters === null) {
sessionStorage.setItem('indexSelectedFilters', '');
tempSelectedFilters = [];
} else {
tempSelectedFilters = JSON.parse(selectedFilters);
}
@joceqo
joceqo / event-loop.md
Created April 3, 2024 13:57 — forked from jesstelford/event-loop.md
What is the JS Event Loop and Call Stack?

Regular Event Loop

This shows the execution order given JavaScript's Call Stack, Event Loop, and any asynchronous APIs provided in the JS execution environment (in this example; Web APIs in a Browser environment)


Given the code

@joceqo
joceqo / index.js
Last active October 20, 2023 10:34
index.js for exotic
console.log('hello simon')
document.addEventListener("DOMContentLoaded", () => {
// 🍪 on init check the monto cookie
function getCookieValue(name) {
const regex = new RegExp(`(^| )${name}=([^;]+)`);
const match = document.cookie.match(regex);
if (match) {
return match[2];
https://l55hw2.csb.app/ds
@joceqo
joceqo / GLSL-Noise.md
Created September 18, 2022 07:59 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

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);
	return mix(rand(fl), rand(fl + 1.0), fc);
}