Skip to content

Instantly share code, notes, and snippets.

@JBlond
JBlond / bash-colors.md
Last active May 14, 2024 12:29 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@JoshuaPurtell
JoshuaPurtell / odd_one_out_benchmark.py
Created May 13, 2024 19:42
How does GPT-4O's internal state tracking stack up?
import asyncio
import os
import random
import hashlib
from datetime import datetime
from typing import Dict, List, Type
from dotenv import load_dotenv
from loguru import logger
from pydantic import BaseModel
@mildsunrise
mildsunrise / README.md
Last active May 14, 2024 12:27
🖥 Lightweight diskless VM with QEMU

🖥 Lightweight diskless VM with QEMU

This document describes a process to quickly setup a Linux VM for testing or kernel development.

The VM requires no disk image, instead it boots off a directory on the host (using virtiofs). This is:

  • more performant (no FS-in-FS overhead)
  • more convenient for experiments (both host and guest can modify files concurrently)
  • safer (no corruption* in case of kernel panic)
  • easier to set up
@mariovalney
mariovalney / pre-commit
Last active May 14, 2024 12:27
Pre-commit hook to check code with PHPCS, fix with PHPCBF and check mess with PHPMD
#!/bin/sh
#########################
# #
# Initializing #
# #
#########################
##
# You should add all tools as composer dependencies or change this path
@icebob
icebob / k3s_helm_install.sh
Last active May 14, 2024 12:25
K3S + Helm installing
# Install K3S
curl -sfL https://get.k3s.io | sh -
# Copy k3s config
mkdir $HOME/.kube
sudo cp /etc/rancher/k3s/k3s.yaml $HOME/.kube/config
sudo chmod 644 $HOME/.kube/config
# Check K3S
kubectl get pods -n kube-system

VimWiki Cheatsheet

[number] refers to the wiki number, set by the order in your vimrc. The default is 1.

Wiki Management

  • [number] <leader> ww - open wiki index file
  • [number] <leader> wt - open wiki index file in new tab
  • <leader> ws - list and select available wikis
  • wd - delete wiki page
@mutability
mutability / OVERLAYFS
Last active May 14, 2024 12:23
readonly root via overlayfs
- install the two shellscripts into the appropriate places under /etc/initramfs-tools
- run update-initramfs
- put "overlay=yes" on the kernel command line
- reboot
With the overlay in place, the real root is mounted readonly on /ro.
Only the root fs is changed, other filesystems are mounted normally.
Remove "overlay=yes" (or change it to something other than yes) and reboot to go back to readwrite.
(This probably means that you want the commandline config to live somewhere other than on the root fs, e.g. under /boot)
@calpt
calpt / README-OpenCLIP-to-Transformers.md
Last active May 14, 2024 12:21
Convert multilingual LAION CLIP checkpoints from OpenCLIP to Hugging Face Transformers

OpenCLIP -> HF Transformers Conversion

Setup

pip install open_clip_torch transformers

Convert

Cheat Sheet para o teste de EW

Setup do projeto

Criar servidor express.js

Para criar um servidor express.js para servir de API:

npx express-generator --no-view nome-do-projeto
@JaysonChiang
JaysonChiang / api.ts
Last active May 14, 2024 12:20
Example of Axios with TypeScript
import axios, { AxiosError, AxiosResponse } from 'axios';
import token from './somewhere';
interface Todo {
id: string;
title: string;
}
interface User {
id: string;