Skip to content

Instantly share code, notes, and snippets.

@OrionReed
OrionReed / dom3d.js
Last active May 8, 2024 06:20
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; // ¯\\_(ツ)_/¯
@passivestar
passivestar / Editor.tres
Last active April 10, 2024 20:07
Godot editor theme
[gd_resource type="Theme" load_steps=12 format=3 uid="uid://7bvxnk5n5imx"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6h42l"]
content_margin_left = 10.5
content_margin_top = 8.75
content_margin_right = 10.5
content_margin_bottom = 8.75
bg_color = Color(0.117647, 0.117647, 0.117647, 1)
draw_center = false
border_color = Color(1, 1, 1, 0.137255)
@pesterhazy
pesterhazy / building-sync-systems.md
Last active May 3, 2024 20:03
Building an offline realtime sync engine

So you want to write a sync system for a web app with offline and realtime support? Good luck. You might find the following resources useful.

Overview articles

@Treeki
Treeki / TurnipPrices.cpp
Last active April 5, 2024 13:55
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@Yukaii
Yukaii / README.md
Last active November 7, 2021 09:48
Editor font & codeblock font cutomization for HackMD
@psa-jforestier
psa-jforestier / lambda_function.py
Created February 5, 2019 10:13
AWS Lambda function to gzip compress file when upload to S3 (will replace original file with gz version)
###
### This gist contains 2 files : settings.json and lambda_function.py
###
### settings.json
{
"extensions" : ["*.hdr", "*.glb", "*.wasm"]
}
### lambda_function.py
/**
* Bear Theme with Typora
*
* @version : 0.0.1
* @update : 2018/09/08
* @homepage: https://gist.github.com/Kenshin/e5adc79da3149315bdfd72a35b70d65e
* @license : MIT https://github.com/kenshin/mduikit/blob/master/LICENSE
* @author : Kenshin Wang <kenshin@ksria.com>
*
* @copyright 2018
'use strict';
// Dependencies
const gcloud = require('google-cloud', {
projectId: 'sara-bigquery',
keyfileName: 'keyfile.json'
});
const vision = gcloud.vision();
const fs = require('fs');
const async = require('async');
@myshov
myshov / function_invocation.js
Last active January 21, 2024 15:14
11 Ways to Invoke a Function
console.log(1);
(_ => console.log(2))();
eval('console.log(3);');
console.log.call(null, 4);
console.log.apply(null, [5]);
new Function('console.log(6)')();
Reflect.apply(console.log, null, [7])
Reflect.construct(function(){console.log(8)}, []);
Function.prototype.apply.call(console.log, null, [9]);
Function.prototype.call.call(console.log, null, 10);
cd hackmd-0.5.0
patch -p1 < x.patch
mkdir public/vendor/abcjs/
wget https://raw.githubusercontent.com/paulrosen/abcjs/master/bin/abcjs_basic_2.3-min.js -O public/vendor/abcjs/abcjs_basic_2.3-min.js

Base: Hackmd 0.5.0 (https://github.com/hackmdio/hackmd/releases/tag/0.5.0)