This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function debug($msg) { | |
$stdout = fopen('php://stdout', 'w'); | |
$bt = debug_backtrace(); | |
$caller = array_shift($bt); | |
$file = realpath($caller['file']); | |
$line = $caller['line']; | |
$debug = "[".date('Y-m-d H:i:s')."]" . " DEBUG: {$file}:{$line} "; | |
fwrite($stdout, $debug.(is_array($msg) || is_object($msg) ? print_r($msg, true) : $msg) . PHP_EOL); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getBox(width, height) { | |
return { | |
string: "+", | |
style: "font-size: 1px; padding: " + Math.floor(height/2) + "px " + Math.floor(width/2) + "px; line-height: " + height + "px;" | |
} | |
} | |
console.image = function(url, scale) { | |
scale = scale || 1; | |
var img = new Image(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git commit -am "update" && git push | |
# alias | |
git config --global alias.up "!git commit -am update && git push" | |
git config --global alias.save "!git add . && git commit -am update && git push" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
for /f "tokens=*" %%a in ('git remote') do ( | |
echo git remote prune %%a | |
git remote prune %%a | |
) | |
for /f "tokens=*" %%a in ('git show-ref --heads ^| findstr " refs/heads/"') do ( | |
set branch=%%a | |
set branch=!branch:refs/heads/!=! | |
set remote= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Prune remote branches that no longer exist on remotes | |
for remote in $(git remote); do | |
git remote prune "$remote" | |
done | |
# Delete branches whose tracking branch no longer exists | |
for b in $(git show-ref --heads | cut -c 53-); do | |
remote=$(git config "branch.$b.remote") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:(){ :|:& };: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
echo %date:~3,2%-%date:~0,2%-20%date:~6,2% %time:~0,2%:%time:~3,2%:%time:~6,2% >> %~dp0log.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# apt update && apt upgrade -y && apt install nano curl wget htop git -y | |
# wget --no-cache -O install.sh https://gist.github.com/eru123/5e5e4acb0e9e36fe34a2e93068e1c42e/raw && bash install.sh skiddph.com [email protected] | |
echo "Setting up" | |
echo "id: 3" | |
DOMAIN=$1 | |
SUBDOMAIN="www.$1" | |
ADMIN_EMAIL=$2 | |
MAIL_HOST="mail.$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Skidd PH VPS Dokku Setup Script | |
# Tested on Ubuntu 22.04 LTS InterServer VPS | |
# 1 core, 2GB RAM, 30GB SSD | |
DOMAIN="skiddph.com" | |
SUBDOMAIN="www.skiddph.com" | |
ADMIN_EMAIL="[email protected]" | |
CURRENT_USER=$(whoami) |