Skip to content

Instantly share code, notes, and snippets.

View MichalZalecki's full-sized avatar

Michał Załęcki MichalZalecki

View GitHub Profile
@acutmore
acutmore / README.md
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: https://dev.to/gajus/my-favorite-css-hack-32g3
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) {
items.push(elements[i]);
}
}
@matux
matux / tablebear
Created April 6, 2018 06:29
How to Tables on Bear app. Copy/paste example _as is_ on a note. (https://www.reddit.com/r/bearapp/comments/8a2k04/how_to_craft_pseudo_tables_on_bear/)
# Playgrounds Markup Cheat Sheet
## Callouts
::Name Description PG QH::
[Note](https://developer.apple.com/library/content/documentation/Xcode/Reference/xcode_markup_formatting_ref/Note.html#//apple_ref/doc/uid/TP40016497-CH39-SW1) Adds a Note callout. ✓ ✓
[Example](https://developer.apple.com/library/content/documentation/Xcode/Reference/xcode_markup_formatting_ref/Example.html#//apple_ref/doc/uid/TP40016497-CH58-SW1) Adds an Example callout. ✓
[Experiment](https://developer.apple.com/library/content/documentation/Xcode/Reference/xcode_markup_formatting_ref/Experiment.html#//apple_ref/doc/uid/TP40016497-CH36-SW1) Adds an Experiment callout. ✓ ✓
[Important](https://developer.apple.com/library/content/documentation/Xcode/Reference/xcode_markup_formatting_ref/Important.html#//apple_ref/doc/uid/TP40016497-CH37-SW1) Adds an Important callout ✓ ✓
[Custom Callout](https://developer.apple.com/library/content/documentation/Xcode/Reference/xcode_markup_formatting_ref/CustomCallouts.html#//apple_re
#![feature(lang_items)]
#![no_std]
#[no_mangle]
pub fn add_one(x: i32) -> i32 {
x + 1
}
// needed for no_std
<link
rel="preload"
href="./fonts/sedgwick-ave-v1-latin-regular.woff2"
as="font"
type="font/woff2"
crossorigin
>
<link rel="stylesheet" href="main.css" />
@BrandonPotter
BrandonPotter / kubernetes-latest-image.md
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
wojteklu / clean_code.md
Last active April 25, 2024 10:22
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
brunogaspar / README.md
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

Installation

@Restuta
Restuta / framework-sizes.md
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 https://cdnjs.com 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