Skip to content

Instantly share code, notes, and snippets.

View prayash's full-sized avatar
🤓

Prayash Thapa prayash

🤓
View GitHub Profile
// Copy-paste into your console (or minify and save as a bookmarklet) to see any DOM in an almost-sorta-working 3D stack of DOM elements.
// The front faces are colored for debugging, if this gist can be fixed, they can return to their normal styling.
(function () {
const MAX_ROTATION = 180;
const DEPTH_INCREMENT = 25;
const PERSPECTIVE = 1000;
const SIDE_FACE_CLASS = 'side-face';
const MAX_DOM_DEPTH = getMaxDepth(document.body);
// Calculate color based on depth, ensuring lighter colors for deeper elements
@prayash
prayash / fluid-photoset.markdown
Created January 11, 2024 09:39
Fluid photoset

Fluid photoset

A photoset that retains the aspect ratio of all images, yet keeping images on the same row at equal heights.

A Pen by Terry Mun on CodePen.

License.

@prayash
prayash / 3DPointsFromDepth.swift
Created October 19, 2022 04:29 — forked from snowzurfer/3DPointsFromDepth.swift
3D world points from ARKit depth
import ARKit
import SceneKit
let horizontalPoints = 256 / 2
let verticalPoints = 192 / 2
var depthNodes = [SCNNode]()
var parentDebugNodes = SCNNode()
var sceneView: ARSCNView!
// Somewhere during setup
@prayash
prayash / diff.mdown
Created October 17, 2020 06:34 — forked from ndarville/diff.mdown
Paul Heckel's Diff Algorithm

[Isolating Differences Between Files][paper]

Advantage over Other Algorithms

The diff output is more specific:

[I]f a whole block of text is moved, then all of it, rather than just the beginning and end, is detected as changed.

>The algorithm described here avoids these difficulties. It detects differences that correspond very closely to our intuitive notion of difference.

@prayash
prayash / js-intern-curriculum-ideas.md
Created May 4, 2020 19:19
Brainstorming some ideas for the JS internship for Will.

JavaScript Internship Curriculum Ideas

@prayash
prayash / Atomics.md
Created April 10, 2020 03:35 — forked from lorentey/Atomics.md
[pitch] Low-Level Atomic Operations ⚛︎
@prayash
prayash / nerd-talk-3-13-19.md
Created March 13, 2019 21:10
Nerd Talk 3/13/2019

Nerd Talk 3/13/2019

JoeJoeJoeJoeJoeJoe

  • Carolina shag didn't happen, still wants to do it.
  • Been doing minor electrical work, fixing light fixtures and stuff around the house.
  • ReasonML stuff is on pause. Should probably take it one at a time instead of spreading too thin.
  • Picked up a short eBook on Zen to Done, a spin on Getting Things Done.

David Iceman

  • 11 year review which led to a few things to work on, but mostly affirmational
@prayash
prayash / MachineLearningResources.md
Created September 15, 2018 19:17 — forked from jcowles/MachineLearningResources.md
Machine learning resources

"AI is the new Electricity"

Andrew Ng lecture, Stanford Graduate School of Business
High level, but totally worth watching.
https://www.youtube.com/watch?v=21EiKfQYZXc

Stanford cs231n, winter 2016

I went looking for lectures from different sources and these are a great "from first principles" introduction. The newer cs231n lectures may have more relevant details, but I like Andrej Karpathy's

/**
* lessons → lerp → map to a new range
* —
*
* Map a number within 0.0 to 1.0 to a new range, such as 20.0 to 50.0.
* For example, scaling a parameter from a start to end value.
*/
const canvasSketch = require('canvas-sketch');
const { lerp } = require('canvas-sketch-util/math');

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?