Skip to content

Instantly share code, notes, and snippets.

View irfan-dahir's full-sized avatar
👀

Irfan (Nekomata) irfan-dahir

👀
View GitHub Profile
@irfan-dahir
irfan-dahir / jikan_installation_script.sh
Last active May 19, 2020 03:22
Quick & dirty local instance installation. I use this for the slave servers only who's only inbound access is restricted to the master. If you're using this locally, that's fine then. Otherwise for production, use it as a reference and secure the permissions on your own accord.
#!/usr/bin/env bash
BUILD_DEPS="zip unzip git"
DEPS="php7.3 curl redis supervisor apache2 php7.3-{xml,mbstring,common,curl,opcache} composer"
JIKAN_PATH="/var/www/jikan"
apt-get update \
&& apt-get -y dist-upgrade \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \
&& echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu $(lsb_release -s -c) main" | tee /etc/apt/sources.list.d/php.list \
@irfan-dahir
irfan-dahir / table.shuffle.lua
Created July 7, 2017 18:01
Shuffles your table arbitrarily
function table.shuffle(input, debug)
if not type(input) == "table" then print("table.shuffle ERROR: <input> must be array") return nil end
if not type(debug) == "nil" or not type(debug) == "boolean" then print("table.shuffle ERROR: <debug> must be nil or boolean") return nil end
if debug == nil then debug = false end -- if debug is true, it'll print the output
math.randomseed(os.time())
local output = {}
while true do