Skip to content

Instantly share code, notes, and snippets.

View kashav's full-sized avatar
🧠

Kashav Madan kashav

🧠
View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active July 22, 2024 08:58
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@tomhicks
tomhicks / plink-plonk.js
Last active July 22, 2024 09:51
Listen to your web pages
@lhorie
lhorie / longest-keyword-sequence.md
Last active November 14, 2022 23:21
What's the longest keyword sequence in Javascript?
@jonalmeida
jonalmeida / presto_fare_total.py
Created October 2, 2018 17:13
Get the total spent from an exported CSV on Presto (prestocard.ca)
#!/usr/bin/env python3
import csv, sys, re
from functools import reduce
"""
From StackOverflow: https://stackoverflow.com/a/32486472
Strips whitespace off from the headers of CSV field names.
"""
This file has been truncated, but you can view the full file.
* (()())
* ((()())())
* (((()())())())
(((()())())(()()))
* ((((()())())())())
((((()())())())(()()))
* ((((()())())(()()))())
((((()())())(()()))(()()))
((((()())())(()()))((()())()))
((((()())())(()()))(((()())())()))
@djmitche
djmitche / mozilla-levels.md
Last active July 15, 2024 22:57
Mozilla Levels

[UPDATE July 2024]

New year, new links:

I don't work at Mozilla any longer, but I'm happy to keep this up-to-date. Please reach out (same username on gmail) with any updates!

[UPDATE June 2020]

Time Travel Debugging

Time Travel refers to the ability to record a tab and later replay it ([WebReplay][wrr]). The technology is useful for local development, where you might want to:

  • pause and step forwards or backwards
  • pause and rewind to a prior state
  • rewind to the time a console message was logged
  • rewind to the time an element had a certain style or layout
  • rewind to the time a network asset loaded
@mholt
mholt / macapp.go
Last active July 21, 2024 09:43
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use:
@gricard
gricard / webpack4upgrade.md
Last active February 29, 2024 20:23
Just some notes about my attempt to upgrade to webpack 4

If you enjoyed reading this, I'm intending to do more blogging like this over here: https://cdgd.tech

This is not a complaint about Webpack or v4 in any way. This is just a record of my process trying it out so I could provide feedback to the webpack team

Hmm... I don't see any docs for 4.0 on https://webpack.js.org. I guess I'll just wing it. All I need to do is npm i -D webpack@next, right?

+ webpack@4.0.0-beta.2