Skip to content

Instantly share code, notes, and snippets.

@bch15
bch15 / Subscriptions
Created November 15, 2023 08:24
V2ray subscriptions
https://tackserver-code.ir/api/json/mrpooya.xyz.json
https://test2.sub-channel.workers.dev/vless/iphone/random
https://raw.githubusercontent.com/yebekhe/TelegramV2rayCollector/main/sub/base64/mix
--------------*------------*---*-----------------------
--------------*------------*---*-----------------------
@johndavisnz
johndavisnz / lockerstor-debian.md
Last active May 1, 2024 20:15
Installing Debian on the Nimbustor4/2 ( as5304t/as5202t )

Whilst Asustor's ADM suits most people, it is possible to install ANY intel operating system on the nimbustor4/2 (as5202t/as5304t) as they run fairly generic intel hardware (asmedia sata controller, rtl8125 2.5gbe nic and ite system management chip)

in this gist I'll detail the steps needed to install and configure Debian11

Before proceeding you need to decide where you're going to install Debian.

Most people will choose to install it to a usb3 attached drive - either a usb3 ssd ( samsung t5 or similar ) or a usb3 hdd. This gives the most straightforward install ( just tell Debian to use the entire usb3 drive to install to ) and maximises available space on the NAS HDDs

The other option is to install Debian direct to the NAS hard drives - that means no extra drive hanging off the nas, and you can raid1 mirror the system partition across all drives for added resiliency ( though this is somewhat limited as the EFI boot partition is only on sda - so in the case of sda failing you'd need to boot off i

@MaherSaif
MaherSaif / hook.js
Created April 22, 2012 12:49
simple javascript hooks system
Expected Result:
----------------
One
Two
Three
Four
Six
# Let's say you were stupid and used the postgres account for something you
# shouldn't have, so you have a database owned by postgres, with all objects
# inside owned by postgres. You regain sanity and want to transfer the
# ownership to an account that isn't a database superuser.
#
# In most cases, reassigning ownership is as simple as using
# REASSIGNED OWNED. However, that does not work if you are using the
# postgres account, so you have to alter the ownership manually.
#
# First, make sure you connect to the database using the postgres account.
@ThomasFrans
ThomasFrans / git-worktree.md
Last active May 1, 2024 20:11
A gentle introduction to Git worktree

A Gentle Introduction to Git Worktree

Git worktree has become a major part of how I use Git over the past year. Anytime I mention it somewhere however, I get reactions from people who have never heard about the feature. Others have heard about it, but don't know how exactly it works or why it's beneficial. That's why I decided to write a short tutorial/introduction on this awesome feature that is baked right into the very git you are already using. I hope this can help people discover worktrees and be a gentle introduction on how to get started using them.

What is Git worktree

Git worktree facilitates working with multiple branches. In a normal Git workflow, you can only ever have one branch checked out at a single time.

@g1eb
g1eb / convertTime.js
Created September 23, 2017 09:21
Convert seconds to a human readable representation
export function convertTime(seconds) {
var seconds = parseInt(seconds, 10)
var hours = Math.floor(seconds / 3600)
var minutes = Math.floor((seconds - (hours * 3600)) / 60)
var seconds = seconds - (hours * 3600) - (minutes * 60)
if ( !!hours ) {
if ( !!minutes ) {
return `${hours}h ${minutes}m ${seconds}s`
} else {
return `${hours}h ${seconds}s`
@chrisveness
chrisveness / crypto-aes-gcm.js
Last active May 1, 2024 20:08
Uses the SubtleCrypto interface of the Web Cryptography API to encrypt and decrypt text using AES-GCM (AES Galois counter mode).
/**
* Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt().
* (c) Chris Veness MIT Licence
*
* @param {String} plaintext - Plaintext to be encrypted.
* @param {String} password - Password to use to encrypt plaintext.
* @returns {String} Encrypted ciphertext.
*
* @example
* const ciphertext = await aesGcmEncrypt('my secret text', 'pw');
// Uncompressed version of
// https://gist.github.com/munificent/b1bcd969063da3e6c298be070a22b604
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#include <stdbool.h> // 2008-2019
const int HEIGHT = 40;
const int WIDTH = 80;
@munificent
munificent / generate.c
Last active May 1, 2024 20:06
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@disler
disler / ADA_v2_README.md
Created April 17, 2024 18:01
Personal AI Assistant: 'Ada' - v0.2

This is not working complete code.

This is strictly a v0.2, scrapy, proof of concept version of a personal AI Assistant working end to end in just ~726 LOC.

This is the second iteration showcasing the two-way prompt aka multi-step human in the loop. The initial, v0, assistant version is here.

It's only a frame of reference for you to consume the core ideas of how to build a POC of a personal AI Assistant.

To see the high level of how this works check out the explanation video. To follow our agentic journey check out the @IndyDevDan channel.