Skip to content

Instantly share code, notes, and snippets.

@colemar
colemar / #wg-peer.md
Last active May 7, 2024 14:06
Manage Wireguard peers (IPv4 only)

Manage Wireguard peers (IPv4 only)

List, add or delete Wireguard peers. Also show client configuration for already added peers.

wg-peer [add|show <peer>|del <peer>|list]

where:

  • a[dd] add a new peer
@mvneves
mvneves / git-split.md
Created December 28, 2017 21:36
How to split a git repository into two different ones

How to split a git repository into two different ones

These are the steps to extract a directory from a git repository (with all its history commit), create a new repository from this directory, and optionally remove it from the original one.

To the ones that are here to copy-paste code, this is an example which removes the MODULE directory from REPO repository.

Step 1: Extract the directory from the git repository

Clone the original repository:

@stravant
stravant / DatastoreBytes.lua
Created October 24, 2023 04:50
Module which packs a sequence of variable length integers into a Datastore safe string at maximal density
local DS_INT_TO_INT = {} :: {[number]: number}
local INT_TO_DS_INT = {} :: {[number]: number}
local INT_TO_DS_CHAR = {} :: {[number]: string}
local DS_INT_MAX;
do
-- All characters under this are control characters, must avoid them because
-- they get expanded out into control sequences.
local MIN_DS_VALUE = 0x20
local MAX_DS_VALUE = 0x7E
@pascalpoitras
pascalpoitras / config.md
Last active May 7, 2024 14:03
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@AndrewMast
AndrewMast / disable_vanguard.vbs
Last active May 7, 2024 14:01
Commands to disable Riot Vanguard when you aren't playing Valorant
' Disables Vanguard from starting when you boot your computer
Call CreateObject("Shell.Application").ShellExecute("cmd.exe", "/c ""sc config vgc start= disabled & sc config vgk start= disabled""", "", "runas")
@FlorSanders
FlorSanders / JetsonNano2GB_LlamaCpp_SetupGuide.md
Created April 11, 2024 15:17
Setup llama.cpp on a Nvidia Jetson Nano 2GB

Setup Guide for llama.cpp on Nvidia Jetson Nano 2GB

This is a full account of the steps I ran to get llama.cpp running on the Nvidia Jetson Nano 2GB. It accumulates multiple different fixes and tutorials, whose contributions are referenced at the bottom of this README.

Procedure

At a high level, the procedure to install llama.cpp on a Jetson Nano consists of 3 steps.

  1. Compile the gcc 8.5 compiler from source.
@mgd216
mgd216 / vue_nuxt_vuetify_migration.md
Last active May 7, 2024 14:00
Vue2 / Vuetify2 Migration to Vue3 / Nuxt3 / Vuetify3

Vue3 / Nuxt3 / Vuetify3 Migration Steps

  • The following notes are a 'checklist' for migrating a large Vue2 / Vuetify2 project to Vue3 / Nuxt3 / Vuetify3. It is NOT intended to be a step-by-step migration guide, they are rough notes our team used for migration
  • Our team decided to create a brand new Nuxt3 app, instead of tyring a 'bridge' or running Vue2/Vue3 side-by-side:
    • nuxi init our-new-app-v3
  • We also changed our store from Vuex to Pinia
  • We decided to use the experimental @vue/reactivity-transform. This provides the ability to use a ref in the script block without having to use .value everywhere
    • without reactivity-transform
      • let userName = ref<string>('')
      • userName.value = "John Doe"
  • with reactivity-transform
@almcarvalho
almcarvalho / gist:38eb6608441fdf68ab4edf7677f90e31
Created December 29, 2022 17:38
Bot Whatsapp - Venom - Lucas
//vocês vão comentar o que tá dentro do bloco if (!message.isGroupMsg) { } e colocar esse codigo aqui:
switch (message.text) {
case '1':
// client.sendText(message.from, "oi").then(() => {
// console.log('Message sent.');
// }).catch(error => console.error('Error when sending message', error));
client.sendVoice(message.from, './teste.mp3').then((result) => {
console.log('Result: ', result); //return object success
})
.catch((erro) => {
@aSemy
aSemy / kjs_type_union_properties.md
Last active May 7, 2024 13:59
Kotlin/JS TypeUnion properties

Hot new strat for defining type-union properties in Kotlin/JS

Demo

// SomeConfig is an external TypeScript interface
// it has a property with a type-union type, but don't implement it as a member...
external interface SomeConfig {
  // multiProp: number | string | Extension | ((string) => Extension | null)
}