Skip to content

Instantly share code, notes, and snippets.

@tianon
tianon / oci-garbage
Created May 20, 2024 21:51
A very, *very* basic PoC of using `jq` to manage and manipulate OCI layouts.
#!/usr/bin/env bash
set -Eeuo pipefail
oci="$PWD" # TODO parameter/flag (and pass it aruond to other oci tools correctly!)
# ~validate $oci is an OCI layout
[ -s "$oci/oci-layout" ]
jq -se 'length == 1 and .[0].imageLayoutVersion == "1.0.0"' "$oci/oci-layout" > /dev/null
# TODO more/better validation? definitely better error handling
@pablotolentino
pablotolentino / Visual Studio 2022 Product Key
Created November 20, 2021 20:41
Visual Studio 2022 Enterprise Product key
Visual Studio 2022
Enterprise :
VHF9H-NXBBB-638P6-6JHCY-88JWH
Professional:
TD244-P4NB7-YQ6XK-Y8MMM-YWV2J
@wojteklu
wojteklu / clean_code.md
Last active May 21, 2024 18:43
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

⚠️ NOT FOR NAVIGATIONAL USE!
These are flash cards I made from study materials and nothing here is fit for navigational use.


If you find any errors, please let me know in the comments below.

Various

@diffficult
diffficult / installing_virt_manager.md
Last active May 21, 2024 18:42
Easy instructions to get virt-manager qemuv/kvm running on Arch

Easy instructions to get QEMU/KVM and virt-manager up and running on Arch

  1. Make sure your cpu support kvm with below command:

     grep -E "(vmx|svm)" --color=always /proc/cpuinfo
    
  2. Make sure BIOS have enable “Virtualization Technology”.

  3. User access to /dev/kvm so add your account into kvm(78) group:

@realvjy
realvjy / ChoasLinesShader.metal
Last active May 21, 2024 18:41
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@Klerith
Klerith / vite-testing-config.md
Last active May 21, 2024 18:39
Vite + Jest + React Testing Library - Configuraciones a seguir

Instalación y configuracion de Jest + React Testing Library

En proyectos de React + Vite

  1. Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react 
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
  1. Opcional: Si usamos Fetch API en el proyecto:
@ryangmolina
ryangmolina / fuzzy_logic.py
Created June 16, 2017 13:26
A simple python implementation of Mamdani Fuzzy Logic
def trimf(x, points):
pointA = points[0]
pointB = points[1]
pointC = points[2]
slopeAB = getSlope(pointA, 0, pointB, 1)
slopeBC = getSlope(pointB, 1, pointC, 0)
result = 0
if x >= pointA and x <= pointB:
result = slopeAB * x + getYIntercept(pointA, 0, pointB, 1)
elif x >= pointB and x <= pointC:
@agoose77
agoose77 / flake.nix
Last active May 21, 2024 18:36
Python virtualenvironment flake
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = inputs @ {
self,
nixpkgs,
flake-utils,
...
@lohhans
lohhans / README-PTBR.md
Last active May 21, 2024 18:36 — forked from PurpleBooth/README-Template.md
Um modelo para fazer um bom README.md

Título do projeto

Um parágrafo da descrição do projeto vai aqui

🚀 Começando

Essas instruções permitirão que você obtenha uma cópia do projeto em operação na sua máquina local para fins de desenvolvimento e teste.

Consulte Implantação para saber como implantar o projeto.