Skip to content

Instantly share code, notes, and snippets.

@wnqueiroz
wnqueiroz / next-js-12-factor-app-support.sh
Created April 23, 2024 17:20
Next.js 12-factor App Support
# -------------------------- .docker/entrypoint.sh --------------------------
#!/bin/bash
DIR=".next"
find "${DIR}" -type f | while read -r file; do
for var in $(env | cut -d= -f1 | grep '^NEXT_PUBLIC'); do
PATTERN="\$${var}"
NEW_VALUE=$(eval echo "\$$var")
SED_COMMAND="s|${PATTERN}|${NEW_VALUE}|g"

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@NotoriousArnav
NotoriousArnav / FRJ-079K-HAWK: Cannibal's Reign.md
Last active April 23, 2024 17:19
Embark on a perilous odyssey to FRJ-079K-HAWK, a planet steeped in darkness and mystery. Join Captain Lyra Hollinger and her intrepid crew as they unravel the chilling secrets of a world scarred by cannibalistic horrors and haunted by the echoes of a forsaken past. Gripping and visceral, "Cannibal's Reign" is a sci-fi epic that explores the limi…

FRJ-079K-HAWK: Cannibal's Reign

Prologue: Whispers in the Void

The cosmos veiled in darkness concealed countless mysteries—FRJ-079K-HAWK, a celestial enigma, remained untouched and forgotten within its infinite corners. A cryptic planet bore testament to despair and desperation concealed beneath its pallid surface and arid stretches.

Act I: Descent into Desolation

Our tale commences with a daring team of interstellar explorers led by the ambitious Captain Lyra Hollinger, emboldened by the prospect of groundbreaking discovery and insatiable curiosity. The crew consisted of the child prodigy and astrobiologist, Eska; Aelius, the skilled navigator; and VEX-3R, the self-aware AI mainframe tasked with ensuring their survival.

@Ashton-W
Ashton-W / Issue.md
Last active April 23, 2024 17:19
GitHub Markdown toggle code block
Click to toggle contents of `code`
CODE!
@TerranRich
TerranRich / PDO_Cheatsheet.php
Last active April 23, 2024 17:18 — forked from hanvari/PDO_Cheatsheet.php
PHP PDO Cheatsheet
<?php
/**
* Reference:
* http://code.tutsplus.com/tutorials/why-you-should-be-using-phps-pdo-for-database-access--net-12059
*/
function connect() {
/**
* No matter what error mode you set,
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active April 23, 2024 17:16
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@luk6xff
luk6xff / ARMonQEMUforDebianUbuntu.md
Last active April 23, 2024 17:11 — forked from bruce30262/ARMDebianUbuntu.md
Emulating ARM with QEMU on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

If there's no qemu-arm-static in the package list, install qemu-user-static instead

@mkfares
mkfares / zsh-keyboard-shortucts.md
Last active April 23, 2024 17:11
Common zsh Keyboard Shortcuts on macOS Catalina

Common zsh Keyboard Shortcuts on macOS

Navigation

CTRL + A : Move the cursor to the beginning of the line
CTRL + E : Move the cursor to the end of the line
OPTION + Left Arrow : Move the cursor one word backward
OPTION + Right arrow : Move the cursor one word forward
Left Arrow : Move the cursor one character backward
Right Arrow : Move the cursor one character forward

@dadodasyra
dadodasyra / PM5_World_converter.php
Created November 5, 2023 19:24
Convert world with plugin code to leveldb (can be used with sort of a TestCommand) it freezes the server until the end of the conversion and automatically detect the base format.
<?php
$originalPath = "/root/servers/miscs/converting/lobby";
$backupPath = "/root/servers/miscs/converting/backup"; //this will create a folder under this one with the name of the world
$providerManager = new WorldProviderManager();
$writableFormats = array_filter($providerManager->getAvailableProviders(), fn(WorldProviderManagerEntry $class) => $class instanceof WritableWorldProviderManagerEntry);
$requiredOpts = [
"world" => "path to the input world for conversion",
"backup" => "path to back up the original files",
Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!newsfeed.arcor.de!newsfeed.freenet.de!novso.com!news-out.newsfeeds.com!local!news.eskimo.com!eskimo.com!scs
From: scs@eskimo.com (Steve Summit)
Newsgroups: comp.lang.c,comp.lang.c.moderated,comp.answers,news.answers
Subject: comp.lang.c Answers to Frequently Asked Questions (FAQ List)
Followup-To: poster
Date: 1 Nov 2008 10:00:10 GMT
Organization: better late than never
Lines: 7132
Approved: news-answers-request@MIT.Edu
Expires: 3 Dec 2008 00:00:00 GMT