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 / HigherOrderTypeLevelFunctions.ts
Last active February 12, 2023 19:57
Higher Order Type Level Functions
/**
* Generic helpers
*/
interface Fn {
input: unknown;
output: unknown;
}
type Call<fn extends Fn, input> = (fn & { input: input })["output"];
@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 / Bugs
Last active October 9, 2022 23:12
SCA Bug Tracker
#### Patron > View
1. Patron details are automatically loaded when scrolling patron's list
**ONLY IN SPECIFIC ACTIONS COMBO** (after deleting a patron)
- Details:
Line 727: Code below is called twice on scroll, and the second time `loadFirst` is `true`
```
.on('draw.dt', function () {
setTimeout(function () {
redraw_dt()
if (loadFirst) {

Logging

Similar to git log, including list of files changed in each commit and hashes and status

git whatchanged

Listing files changed by commit including current status

git log --name-status

Lists only changed files by commit

git log -p --name-only