Skip to content

Instantly share code, notes, and snippets.

View robske110's full-sized avatar

Tim (robske_110) robske110

  • Germany
View GitHub Profile
@robske110
robske110 / LayDown.php
Created December 17, 2016 16:20
A small (Script)Plugin that does all kind of crazy stuff to the player...
<?php
/**
* @name LayDown
* @main robske_110\LayDown\LayDown
* @version 1.0.0alpha
* @api 2.1.0
* @description Experience everything Upside Down!
* @author robske_110
*/
@robske110
robske110 / LeapYear.php
Last active September 13, 2017 11:51
Calculates if $year is a leapyear...
<?php
function isLeapYear(int $year): bool{
return (is_int($year / 4) || is_int($year / 400)) ? (!is_int($year / 100) || is_int($year / 400)) : false;
}
@robske110
robske110 / keybase.md
Created December 20, 2016 15:41
What did you expect? Some key 🔑 to the world?

Keybase proof

I hereby claim:

  • I am robske110 on github.
  • I am robske_110 (https://keybase.io/robske_110) on keybase.
  • I have a public key whose fingerprint is 5015 859F D09F 5B50 875A BC08 135F 9978 BB31 1E40

To claim this, I am signing this object:

@robske110
robske110 / AppleEventTimer.php
Created September 13, 2017 11:49
A nerdy timer to count down the final minutes to an Apple event.
<?php
//Just for fun
$appleEventTimer = new AppleEventTimer(strtotime("12 September 2017"));
$appleEventTimer->start();
echo("AppleEventTimer> exit, APPLE EVENT IS NOW!\n");
class AppleEventTimer{
/** @var int */
const APPLE_EVENT_TIME = 19; //h
@robske110
robske110 / PngToPlayer.php
Last active August 13, 2020 22:59 — forked from jasonw4331/PngToPlayer.php
Set a player's skin in PMMP
<?php
$path = 'your/path/to/skin.png';
$img = @imagecreatefrompng($path);
$bytes = '';
$l = (int) @getimagesize($path)[1];
for ($y = 0; $y < $l; $y++) {
for ($x = 0; $x < 64; $x++) {
$rgba = @imagecolorat($img, $x, $y);
@robske110
robske110 / epicwing.yml
Created November 2, 2017 21:48
A wing used to test&showcase the custom Wing feature for PlayerParticles.
name: EpicWing
spacing: 0.1
particles:
F: TYPE_FLAME
L: TYPE_DRIP_LAVA
model: "FFXXXXXXXXXXXXXXXXXXFF\nFLFXXXXXXXXXXXXXXXXFLF\nFLLFXXXXXXXXXXXXXXFLLF\nFLLLFXXXXXXXXXXXXFLLLF\nFLLLLFXXXXXXXXXFFLLLLF\nFLLLLLFXXXXXXXXFLLLLLF\nFLLLLLFXXXXXXXXFLLLLLF\nFLLLLFFXXXXXXXXFFLLLLF\nFLLLFXXXXXXXXXXXXFLLLF\nFLLFXXXXXXXXXXXXXXFLLF\nFLFXXXXXXXXXXXXXXXXFLF\nFFXXXXXXXXXXXXXXXXXXFF"
centermode: "static"
@robske110
robske110 / dynTableCopy.php
Created March 14, 2021 17:39
Easy to use dynamic SQL table copier
<?php
// DynTableCopy
// Copyright robske_110 2021
declare(strict_types=1);
$dbConnectionConfig = [
"DB_SRC_HOST" => null,
"DB_SRC_NAME" => null,
"DB_SRC_USER" => null,
@robske110
robske110 / pgsqlcreateuser.sh
Last active June 11, 2021 22:02
Postgres fast and secure user creation script. Usage: pgsqlcreateuser <username> [dbname] Prints generated password.
#!/bin/bash
pg_pw=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
sudo su postgres -c "psql -c \"DO \\$\\$
BEGIN
IF EXISTS (SELECT FROM pg_roles WHERE rolname='$1') THEN
ALTER ROLE $1 WITH PASSWORD '$pg_pw';
ELSE
CREATE USER $1 WITH PASSWORD '$pg_pw';
END IF;