Skip to content

Instantly share code, notes, and snippets.

View MisterFixx's full-sized avatar
🦵
leg

Jordan Jones MisterFixx

🦵
leg
View GitHub Profile
/* The MIT License (MIT)
Copyright (c) 2020 Mister_Fix
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@MisterFixx
MisterFixx / BetterMySQLi.php
Created August 17, 2019 18:37
BetterMySQLi.php
<?php
/**
* BetterMySQLi.php
*
* PHP class that allows the usage of some MySQLi functions inline to save space on short queries
* @author Mister_Fix <me@misterfix.io>
* @package BetterMySQLi
* @version v 1.0
* @license MIT License
*/
<?php
class render3DPlayer{
public function __construct($src, $displayHair, $headOnly, $ratio) {
$this->playerSkin = $src;
$this->head_only = ($headOnly == 'true');
$this->display_hair = ($displayHair != 'false');
$this->ratio = $ratio;
}
public function get3DRender() {
$this->hd_ratio = imagesx($this->playerSkin) / 64;
@MisterFixx
MisterFixx / squid.conf
Created March 20, 2019 16:30
MojangPipe squid conf file
#Access rules cluster, here, we define that squid will only accept connections from within the machine (localhost/127.0.0.1)
#Also here we define which IP will be used to make the outgoing request depending on which port the client connected to squid.
#We intentionally avoid using Squid's default port (3128) to avoid various port scanning bots discovering our squid instance and trying to use it for various malicious purposes.
#This is just an extra safeguard, you should still block all of squid's port from public access via your firewall.
#We learned this through the hard way. (https://misterfix.io/i/490823964394917888.png)
#Replace these IP's which the IP's assigned to your machine.
acl 3129 myportname 3129 src 127.0.0.1
http_access allow 3129
tcp_outgoing_address 1.1.1.1 3129
@MisterFixx
MisterFixx / Snowflake.php
Last active August 12, 2019 13:41
Php class to fetch snowflakes from JSnowflake (https://github.com/MisterFixx/JSnowflake)
<?php
/**
* Snowflake.php
*
* Licensed under The MIT License
* @author Mister_Fix <me@misterfix.io>
* @package Snowflake
* @version v 2.0
* @license MIT License
*
@MisterFixx
MisterFixx / render.php
Last active August 29, 2015 14:08 — forked from Olical/render.php
<?php
function flip(&$img)
{
$size_x = imagesx($img);
$size_y = imagesy($img);
$temp = imagecreatetruecolor($size_x, $size_y);
$x = imagecopyresampled($temp, $img, 0, 0, ($size_x-1), 0, $size_x, $size_y, 0-$size_x, $size_y);
return $temp;
}