Skip to content

Instantly share code, notes, and snippets.

@plugn
plugn / throttle-debounce.js
Created June 4, 2026 21:14
throttle & debounce from scratch
function throttle(fn, delay) {
let startTime = 0
return function (...args) {
const now = Date.now()
// if not in progress
if (startTime === 0) {
startTime = now
}
body {
min-height: 100vh;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
}
div {
width: 105px;
@plugn
plugn / dwbGuy.svg
Created October 24, 2025 15:58
dwbGuy
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@plugn
plugn / nginx_macos.md
Created April 4, 2025 08:54 — forked from osamaqarem/nginx_macos.md
Nginx on MacOS

Install nginx (Homebrew)

brew install nginx

Configuration file for nginx will be at /usr/local/etc/nginx/nginx.conf

Web apps can be stored at /usr/local/var/www

Commands

Start:

@plugn
plugn / get-event-listeners.js
Created November 28, 2024 15:53 — forked from cmckni3/get-event-listeners.js
Get all event listeners on page
window.getAllEventListeners = () => {
return Array.from(document.querySelectorAll('*')).map(element => {
const listeners = getEventListeners(element);
return {
element: element,
listeners: Object.keys(listeners).map(key => {
return {
event: key,
@plugn
plugn / index.html
Last active November 14, 2024 09:58
JointJS+: PDF Export
<div id="app">
<div id="paper-container"></div>
</div>
<div id="toolbar-container"></div>
<a target="_blank" href="https://www.jointjs.com">
<img id="logo" src="https://assets.codepen.io/7589991/jointjs-logo.svg" width="200" height="50"></img>
</a>
@plugn
plugn / Search my gists.md
Created August 28, 2024 21:07 — forked from OrenBochman/Search my gists.md
How to search gists

Gist Search Cheatsheet

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:orenbochman

Find all gists with a .yml extension.
extension:yml

@plugn
plugn / index.html
Created July 10, 2024 16:55
Paste image from clipboard.
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<p>Hit Cmd or Ctrl V with an image on your clipboard. Click on image and hit Backspace to remove.</p>
@plugn
plugn / download-from-facecast.md
Created June 10, 2024 09:59 — forked from cornerot/download-from-facecast.md
How download video from facecast.net
@plugn
plugn / index.html
Created February 29, 2024 16:19
JointJS: Shapes Drawing
<div id="paper-container"></div>
<div id="tools">
<input type="radio" name="tools" id="Pointer">
<label for="Pointer">Pointer</label>
<input type="radio" name="tools" id="Line">
<label for="Line">Line</label>
<input type="radio" name="tools" id="Rectangle" checked>
<label for="Rectangle">Rectangle</label>
<input type="radio" name="tools" id="Ellipse">