Skip to content

Instantly share code, notes, and snippets.

@dedurus
dedurus / DOM3D.js
Created March 27, 2024 14:18 — forked from OrionReed/dom3d.js
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; // ¯\\_(ツ)_/¯
@dedurus
dedurus / gist:d6001acbacbab980def12df7da816975
Created November 27, 2023 02:47 — forked from levelsio/gist:5bc87fd1b1ffbf4a705047bebd9b4790
Secret of Monkey Island: Amsterdam (by @levelsio) or how to create your own ChatGPT image+text-based adventure game
2023-11-27 MIT LICENSE
Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com.
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town.
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this.
It's much easier than you think and you'll be shocked by how relatively well it works with little work.
@dedurus
dedurus / LaravelWhereLikeMacro.php
Created October 29, 2023 15:07 — forked from MrPunyapal/LaravelWhereLikeMacro.php
Laravel Custom 'whereLike' Macro for Dynamic 'LIKE' Searches including relationships
<?php
use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Arr;
class AppServiceProvider extends ServiceProvider
{
// ...
@dedurus
dedurus / accent-pf550.js
Created June 27, 2023 16:25 — forked from vordan/accent-pf550.js
Kodovi za rabota so fiskalen printer na Accent PF-550 (PF-500)
var codes_pf500 = {
adjust_date : Chr(61), // 3D
open_smetka : Chr(48), // 30
close_smetka : Chr(56), // 38
open_storno : Chr(85), // 55
close_storno : Chr(86), // 56
stavka : Chr(49), // 31
vtor_red : Chr(10), // 0A
kraj_opis : Chr(9), // 09
@dedurus
dedurus / github-proxy-client.js
Created March 16, 2022 03:47 — forked from DavidWells/github-proxy-client.js
Full Github REST api in 34 lines of code
/* Ultra lightweight Github REST Client */
// original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const token = 'github-token-here'
const githubClient = generateAPI('https://api.github.com', {
headers: {
'User-Agent': 'xyz',
'Authorization': `bearer ${token}`
}
})
@dedurus
dedurus / twittermute.txt
Created February 7, 2022 16:04 — forked from IanColdwater/twittermute.txt
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
import type { FunctionComponent } from "react";
export const combineProviders = (providers: FunctionComponent[]) => providers.reduce(
(Combined, Provider) => ({ children }) => (
<Combined>
<Provider>{children}</Provider>
</Combined>
),
);
@dedurus
dedurus / mk-subnets.txt
Created January 10, 2021 20:20 — forked from Alfakom-MK/mk-subnets.txt
Macedonian Subnets
5.32.176.0/21
31.3.88.0/21
31.7.168.0/21
31.11.64.0/18
31.12.16.0/20
31.210.11.152/30
37.25.80.0/21
37.26.96.0/21
38.19.1.28/30
38.28.1.36/32
@dedurus
dedurus / 1.js
Created November 14, 2018 18:38 — forked from getify/1.js
experiment: mimicking React's new "useState()" hook for stand-alone functions, including "custom hooks"
"use strict";
[foo,bar] = TNG(foo,bar);
// NOTE: intentionally not TNG(..) wrapping useBaz(), so that it's
// basically like a "custom hook" that can be called only from other
// TNG-wrapped functions
function foo(origX,origY) {
var [x,setX] = useState(origX);
var [y,setY] = useState(origY);
@dedurus
dedurus / LICENSE.txt
Created October 26, 2018 01:24 — forked from jed/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE