Skip to content

Instantly share code, notes, and snippets.

View MichalZalecki's full-sized avatar

Michał Załęcki MichalZalecki

View GitHub Profile
acutmore /
Last active January 21, 2024 20:30
Emulating a 4-Bit Virtual Machine in (TypeScript\JavaScript) (just Types no Script)

A compile-time 4-Bit Virtual Machine implemented in TypeScript's type system. Capable of running a sample 'FizzBuzz' program.

Syntax emits zero JavaScript.

type RESULT = VM<
    ["push", N_1],         // 1
    ["push", False],       // 2
 ["peek", _], // 3
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit:
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
matux / tablebear
Created April 6, 2018 06:29
How to Tables on Bear app. Copy/paste example _as is_ on a note. (
# Playgrounds Markup Cheat Sheet
## Callouts
::Name Description PG QH::
[Note]( Adds a Note callout. ✓ ✓
[Example]( Adds an Example callout. ✓
[Experiment]( Adds an Experiment callout. ✓ ✓
[Important]( Adds an Important callout ✓ ✓
[Custom Callout](
pub fn add_one(x: i32) -> i32 {
x + 1
// needed for no_std
<link rel="stylesheet" href="main.css" />
BrandonPotter /
Last active February 21, 2020 01:20
Force Kubernetes to pull latest container image in a deployment

Force Kubernetes to pull latest container image in a deployment

kubectl patch deployment DEPLOYMENT_NAME -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"
wojteklu /
Last active May 25, 2024 07:53
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.

General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

brunogaspar /
Last active October 7, 2022 09:08
Install wkhtmltopdf on Ubuntu (14.04 64-bit) or (16.04 64-bit)

Install wkhtmltopdf on Ubuntu

This was tested on:

  • Ubuntu 14.04 x64
  • Ubuntu 16.04 x64


Restuta /
Last active March 7, 2024 00:01
Sizes of JS frameworks, just minified + minified and gzipped, (React, Angular 2, Vue, Ember)

Below is the list of modern JS frameworks and almost frameworks – React, Vue, Angular, Ember and others.

All files were downloaded from and named accordingly. Output from ls command is stripped out (irrelevant stuff)

As-is (minified)

$ ls -lhS
566K Jan 4 22:03 angular2.min.js