Skip to content

Instantly share code, notes, and snippets.

View ZebTheWizard's full-sized avatar
🧩
PHP: Hypertext Preprocessor (PHP)

Zeb ZebTheWizard

🧩
PHP: Hypertext Preprocessor (PHP)
View GitHub Profile
@ZebTheWizard
ZebTheWizard / install.php
Last active September 25, 2021 14:30
Cpanel git bare
<?php
// 1. place this install script in your public_html/ folder
// 2. go to example.com/install.php to generate all the files
// 3. add basic authentication users by clicking "manager users"
// 4. add the new remote "example.com/repos/git.cgi/<repo>.git"
// 5. remove the install.php script if it still exists.
ini_set('display_errors', 1);
DEFAULT_DIRECTORY="$HOME"
LAST_CD_DIRECTORY=$(cat $HOME/.last_cd_directory 2>/dev/null)
CURRENT_SHELL="$0"
function go_to_default_or_previous
{
if (( $(ps aux | grep $CURRENT_SHELL | grep -v $$ | wc -l) > 0))
then
export DEFAULT_DIRECTORY="$LAST_CD_DIRECTORY"
fi
@ZebTheWizard
ZebTheWizard / Twitch_Auto_Loot_Script.js
Last active April 20, 2020 04:33
A simple javascript function that automatically collects loot on twitch streams.
// COPY AND PASTE ONE OF THE OTHER.
// THE SCRIPT WILL START AUTOMATICALLY.
// USE autoLoot.stop() to stop the script.
// USE autoLoot.every(insertTimeHere) to set how often the script executes.
// USE autoLoot.start() to start the script.
// MINIFIED VERSION
Object.assign(window,{l:console.log,r:console.clear,autoLoot:{i:null,t:5* 1e3,c:0,every:function(t){this.t=t},_c:function(){r(),this.c+=1;try{document.querySelector(".tw-button.tw-button--success.tw-interactive").click(),l(`ATTEMPT ${this.c}: LOOT FOUND!!`)}catch(t){l(`ATTEMPT ${this.c}: no loot`)}},start:function(){if(this.i)return l("Already started. Run autoLoot.stop() to stop.");r(),l("STARTING AUTO LOOT SCRIPT\n================="),this._c(),this.i=setInterval(this._c.bind(this),this.t)},stop:function(){if(!this.i)return l("Already stopped. Run autoLoot.start() to start.");l("STOPPED AUTO LOOT SCRIPT\n================="),this.i=clearInterval(this.i)}}}).autoLoot.start();
// RAW VERSION
#!/bin/sh
FOLDER=$1
MAIN=$2
NAME=$3
IP=$4
sudo apt-get update
sudo apt-get install -y python3-pip python3-dev nginx
sudo pip3 install virtualenv
mkdir "$FOLDER/$NAME"
@ZebTheWizard
ZebTheWizard / games.php
Created June 10, 2017 19:43
List of video games
<?php
return [
"Ark Survival Evolved",
"Assassin's Creed II",
"Batman: Arkham Asylum",
"Batman: Arkham City",
"Battlefield",
"Battlefield 2",
"Battlefield 3",
"Battlefield 4",
@ZebTheWizard
ZebTheWizard / rockPaperScissors.rb
Last active March 25, 2017 18:50
Ruby | Rock Paper Scissors
gameIsRunning = true
$score_computer = 0
$score_player = 0
$score_ties = 0
showScore = false
choices = ["rock", "paper", "scissors"]
def start
puts "--------------------------------------------------------"
puts " R O C K P A P E R S C I S S O R S "
@ZebTheWizard
ZebTheWizard / custom_video_controls.html
Created December 29, 2016 06:50
HTML5 Video | How to create custom controls
<style media="screen">
.video-wrapper{
position: relative;
display: inline-block;
overflow: hidden;
z-index: 1;
transition: all 0.5s ease 0s;}
.btn-wrapper {
background: rgba(255, 255, 255, 0.62);
position: absolute;