Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@joahg
joahg / domSniper.js
Last active March 4, 2020 13:50
domSniper is a simple JavaScript bookmarklet to easily remove a DOM node from a document using JavaScript
(function(){
var body = document.body;
var snipe = function(e) {
body.style.cursor = 'initial';
e.preventDefault();
e.target.parentNode.removeChild(e.target);
body.removeEventListener('click', snipe, false);
};
body.addEventListener('click', snipe, false);
body.style.cursor = 'crosshair';
@bruth
bruth / README.md
Last active November 23, 2022 21:54
Postgres push notification

Postgres push triggers

Watch a table for changes and push a notification with a payload describing the change.

Example

In the Postgres shell:

-- Create the functions
@chriswhong
chriswhong / RadiusMode.js
Created March 1, 2018 12:04
RadiusMode, a custom mode for mapbox-gl-draw for drawing a radius
// custom mapbopx-gl-draw mode that modifies draw_line_string
// shows a center point, radius line, and circle polygon while drawing
// forces draw.create on creation of second vertex
import MapboxDraw from 'mapbox-gl-draw';
import numeral from 'numeral';
import lineDistance from 'npm:@turf/line-distance';
const RadiusMode = MapboxDraw.modes.draw_line_string;
@robertschnuell
robertschnuell / esp32-touch-deepsleep-mqtt.ino
Last active June 12, 2018 17:11
ESP32 touch detection - mqtt - deepsleep example
/*
Example code: Detects a touch input which wakes up the esp32 from deepsleep.
Then connects to a WiFi and post the touch event via MQTT.
After finishing this the esp32 will go back to deppsleep.
This whole process takes around 800ms to finish.
author: @robertschnuell
https://interaktives.design
@rotoglup
rotoglup / 201909 - a look into threejs editor.md
Last active February 10, 2022 10:26
201909 - A look into threejs editor app

A look into threejs editor

My notes while reading the source code from threejs Editor app, as I've been curious about :

  • the editor architecture
  • the undo/redo system
  • the camera control behaviour & code
  • the object transform gizmos behaviours & code
@lbrutti
lbrutti / RadiusMode.js
Created January 10, 2021 18:26 — forked from chriswhong/RadiusMode.js
RadiusMode, a custom mode for mapbox-gl-draw for drawing a radius
// custom mapbopx-gl-draw mode that modifies draw_line_string
// shows a center point, radius line, and circle polygon while drawing
// forces draw.create on creation of second vertex
import MapboxDraw from 'mapbox-gl-draw';
import numeral from 'numeral';
import lineDistance from 'npm:@turf/line-distance';
const RadiusMode = MapboxDraw.modes.draw_line_string;