Skip to content

Instantly share code, notes, and snippets.

@TerranRich
TerranRich / PDO_Cheatsheet.php
Last active April 23, 2024 17:17 — 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
@codecorsair
codecorsair / request.ts
Last active April 23, 2024 17:08
Simple TypeScript XMLHttpRequest
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
export interface RequestOptions {
ignoreCache?: boolean;
headers?: {[key: string]:string};
// 0 (or negative) to wait forever
timeout?: number;
@christyxgeorge
christyxgeorge / yt-transcribe.py
Created September 23, 2023 07:19
Transcribe youtube video on an Intel Mac
"""Script to run whisper on youtube video"""
## Transcribe Andrej Karpathy's video on Making GPT
## Whisper.cpp on Intel Mac takes almost an hour and a half to transcribe the 1 hr 56 min video
# Install pre-reqs:
# !pip install git+https://github.com/openai/whisper.git
# !pip install pytube
import pytube as pt
@schacon
schacon / better-git-branch.sh
Created January 13, 2024 18:41
Better Git Branch output
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NO_COLOR='\033[0m'
BLUE='\033[0;34m'
YELLOW='\033[0;33m'
NO_COLOR='\033[0m'
@GetVladimir
GetVladimir / Force-RGB-Color-on-M1-Mac.md
Last active April 23, 2024 17:06
Force RGB Color on M1 Mac

Force RGB Color on M1 Mac

How to Force RGB Color Output instead of YPbPr on your M1 Apple Silicon Mac for an External Monitor.

This step-by-step video tutorial will guide you through the procedure of forcing RGB color output on your M1 Mac.

Force RGB Color on M1 Mac

Here is the direct link to the video tutorial: https://www.youtube.com/watch?v=Z1EqH3fd0V4

The video also has Closed Captions (Subtitles) that you can enable, to make it easier to follow if needed.