Skip to content

Instantly share code, notes, and snippets.

@wisniewski94
wisniewski94 / definition.js
Created November 10, 2022 21:02
Declarative Shadow DOM Experiment
const range = (min, max) => (min - max) * Math.random() + max;
class Particle {
constructor(x, y, canvas) {
this.setPhysics();
this.setDimensions();
this.setGraphics();
this.x = x;
this.y = y;
this.canvas = canvas;
@rasmusmerzin
rasmusmerzin / build.zig
Last active May 4, 2023 07:34
ABI Zig 🔗 Typescript
// see https://gitlab.com/merzin/mono/-/tree/mono/abi
const std = @import("std");
pub fn build(b: *std.build.Builder) void {
const mode = b.standardReleaseOptions();
const lib = b.addSharedLibrary("index", "index.zig", b.version(0, 0, 0));
lib.setBuildMode(mode);
lib.setTarget(.{ .cpu_arch = .wasm32, .os_tag = .freestanding });
lib.setOutputDir("zig-out");
from ast import *
from pygraphviz import AGraph
from re import sub
COLOR_KWD = '#a020f0'
COLOR_VAR = '#6c71c4'
COLOR_STR = '#8b2252'
def colorize(s, col):
return '<font color="%s">%s</font>' % (col, s)
@rebeccasc
rebeccasc / Readme.md
Last active March 28, 2024 19:38
D3 multiple parents tree - collapsable, resizable
@badsyntax
badsyntax / vscode-grpc.md
Last active November 16, 2023 23:17
The problem with using grpc in a vscode extension

Background

I'm using websockets & protobuf in my vscode extension. I want to replace the message abstractions & inconsistent code with a nicely defined server/client interface using grpc.

The Problem

After working on some POC code and running the extension for the first time, I was faced with the following error:

Activating extension 'richardwillis.vscode-gradle' failed: 
@WebReflection
WebReflection / dom-libraries.md
Last active February 24, 2025 11:28
A recap of my FE / DOM related libraries

My FE/DOM Libraries

a gist to recap the current status, also available as library picker!

Minimalistic Libraries

do one thing only and do it well

  • µhtml (HTML/SVG auto-keyed and manual keyed render)
  • augmentor (hooks for anything)
  • wickedElements (custom elements without custom elements ... wait, what?)
@mrVanboy
mrVanboy / codeclimate-to-markdown.md
Last active January 10, 2024 11:58
Markdown table from code-climate.json with jq

Example of the creating markdown table from the gl-code-quality-report.json Gitlab's code quality report with codeclimate SPEC.

  1. Install jq
  2. Run the next command to convert gl-code-quality-report.json to markdown:
    jq -r '. | sort_by((.location.path | explode | map(-.)), .location.lines.begin) | .[] | @text "| [\(.location.path):\(.location.lines.begin)](../blob/BRANCH-NAME/\(.location.path)#L\(.location.lines.begin)) | \(.description)"' gl-code-quality-report.json
  3. Add table header to the beggigning of the output:

| Path | Description |

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@swayvil
swayvil / data-example.json
Last active December 5, 2024 14:18
D3.js collapsing tree with boxes
{
"tree" : {
"nodeName" : "NODE NAME 1",
"name" : "NODE NAME 1",
"type" : "type3",
"code" : "N1",
"label" : "Node name 1",
"version" : "v1.0",
"link" : {
"name" : "Link NODE NAME 1",
@varemenos
varemenos / 1.README.md
Last active April 4, 2025 03:30
Git log in JSON format

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit