Skip to content

Instantly share code, notes, and snippets.

@ityonemo
ityonemo / test.md
Last active May 8, 2024 20:17
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@m-radzikowski
m-radzikowski / script-template.sh
Last active May 4, 2024 04:13
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@luminoso
luminoso / mtg.service
Last active January 10, 2021 10:18
[mtg.service] #mtg #systemd #proxy #service
[Unit]
Description=mtproxy
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
ExecStart=/opt/mtg run -v -w 128KB -r 128KB --prefer-ip ipv6 --cloak-port 993 -b 0.0.0.0:443 ee5c557d37ddde51c21d4577a29b88bbcc6d747072782e6e6f772e696d
AmbientCapabilities=CAP_NET_BIND_SERVICE
Restart=never
@aleclarson
aleclarson / rollup-typescript.md
Last active May 6, 2024 19:37
The best Rollup config for TypeScript libraries

Features

🔥 Blazing fast builds
😇 CommonJS bundle
🌲 .mjs bundle
.d.ts bundle + type-checking
🧐 Source maps

Install

@coolaj86
coolaj86 / README.md
Last active September 26, 2021 13:51
Backup Telebit

How to Backup Telebit Config, Service, and App

If you need to re-install Telebit (which you probably do, if you're reading this), you should backup up your old config.

Here's how:

Mac Users

# Stop and unload the current telebit process
public class AsyncLazyPipeline<TSource>
{
private Func<Task<TSource>> Expression { get; }
public AsyncLazyPipeline(Func<Task<TSource>> expression)
{
Expression = expression;
}
public Task<TSource> Flatten() => Expression();
# Only install when sshd service is not available
if (-Not (Get-Service sshd -ErrorAction SilentlyContinue))
{
# Install choco
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Install SSH
choco install openssh --yes
# Install SSH server
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"copyOnSelect": false,
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
// Add custom keybindings to this array.
// To unbind a key combination from your defaults.json, set the command to "unbound".
// To learn more about keybindings, visit https://aka.ms/terminal-keybindings
"keybindings":
[
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
@itshaadi
itshaadi / AdGuardHome.txt
Last active March 13, 2022 17:42
لیست سرویس های تبلیغاتی ایران
||yektanet.com^
||popfa.ir^
||mediaad.org^
||tapsell.ir^
||popupme.net^
||kaprila.com^
||popupplus.ir^
||amarfa.ir^
||adro.co^
||adtube.ir^
(In both Windows)
1. Go to C:\Users\{USER}\AppData\Roaming\AnyDesk
2. Copy & Paste 'thumbnails'
3. Open 'user.conf'
4. Replace the line 'ad.roster.items='
5. Done.