Skip to content

Instantly share code, notes, and snippets.

@imhalid
imhalid / 💻 Recent coding in languages
Last active June 20, 2022 01:58
Recent coding in languages
JavaScript +214/ -65 █████▋░░░░░░░░░░░░░░░ 27.0%
Markdown +242/ -17 █████▍░░░░░░░░░░░░░░░ 25.9%
SVG +2/ -0 ███▉░░░░░░░░░░░░░░░░░ 18.9%
CSS +367/ -20 ███▏░░░░░░░░░░░░░░░░░ 15.4%
HTML +159/ -48 ██▋░░░░░░░░░░░░░░░░░░ 12.8%
🌞 Morning 45 commits ███▌░░░░░░░░░░░░░░░░░ 17.2%
🌆 Daytime 50 commits ████░░░░░░░░░░░░░░░░░ 19.2%
🌃 Evening 89 commits ███████▏░░░░░░░░░░░░░ 34.1%
🌙 Night 77 commits ██████▏░░░░░░░░░░░░░░ 29.5%
@imhalid
imhalid / .prettierrc
Created January 2, 2023 21:19
Prettier Config
{
"arrowParens": "avoid",
"bracketSpacing": true,
"endOfLine": "lf",
"bracketSameLine": false,
"jsxSingleQuote": true,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"semi": false,
@imhalid
imhalid / consoleLogToDiv.js
Created January 18, 2023 21:48
Sending console output into an HTML element
import { useEffect } from 'react'
const ConsoleLog = () => {
useEffect(() => {
if (typeof console !== 'undefined') {
if (typeof console.log !== 'undefined') {
console.olog = console.log
} else {
console.olog = function () {}
}
@imhalid
imhalid / content.js
Created February 25, 2023 14:14
Remove news from Bing
const scrollCont = document.querySelector("#scroll_cont");
scrollCont.style.display = "none";
const inputform = document.querySelector("#sb_form");
inputform.style.marginTop = "30vh";
import { useEffect, useState } from 'react'
const useKeyPress = targetKey => {
const [keyPressed, setKeyPressed] = useState(false)
useEffect(() => {
const downHandler = ({ key }) => {
if (key === targetKey) {
setKeyPressed(true)
}
@imhalid
imhalid / GLSL-Noise.md
Created December 10, 2023 09:07 — 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);
@imhalid
imhalid / planeCurve.js
Last active December 11, 2023 19:55
Plane Curve Function
// g: Geometry
// z: Depth
// source: https://jsfiddle.net/gkmqzp1w/9/
function planeCurve(g, z){
let p = g.parameters;
let hw = p.width * 0.5;
let a = new THREE.Vector2(-hw, 0);
let b = new THREE.Vector2(0, z);
@imhalid
imhalid / worldwide_speed_league_data.csv
Last active February 20, 2024 21:29
worldwide_speed_league_data.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 8 columns, instead of 9. in line 1.
Position,country,CountryCode,Region,Mean download speed (Mbps),Unique IPs tested,Total tests,How long it takes to download a 5GB movie (HH:MM:SS)
1,Jersey,JE,WESTERN EUROPE,264,52,1336,45280,00:02:35
2,Liechtenstein,LI,WESTERN EUROPE,246,76,1060,4146,00:02:46
3,Macau,MO,ASIA (EX. NEAR EAST),231,40,1867,9505,00:02:57
4,Iceland,IS,WESTERN EUROPE,229,35,3472,70572,00:02:59
5,Gibraltar,GI,WESTERN EUROPE,206,27,628,6620,00:03:19
6,Andorra,AD,WESTERN EUROPE,190,40,1303,12038,00:03:35
7,Luxembourg,LU,WESTERN EUROPE,162,21,9147,107359,00:04:13
8,Taiwan,TW,ASIA (EX. NEAR EAST),153,51,72542,266095,00:04:27
9,France,FR,WESTERN EUROPE,152,45,7194414,17343867,00:04:29

CSS Colors from MDN