Skip to content

Instantly share code, notes, and snippets.

View zllovesuki's full-sized avatar

Rachel Chen zllovesuki

View GitHub Profile
@zllovesuki
zllovesuki / gist:83d21858e7810105f42e
Created June 13, 2014 10:16
Image Conversion Collision solution
<?php
date_default_timezone_set('UTC');
error_reporting(0);
if (isset($_GET['path']))
{
$path = $_GET['path'];
}
@zllovesuki
zllovesuki / cache.url.php
Created June 13, 2014 19:53
Cache URL Generator
<?php
$retina = true;
$key = 'kokenwtf'; //ENTER YOUR OWN KEY
if ($_GET['key'] != $key) die;
$ds = DIRECTORY_SEPARATOR;
$root = dirname(__FILE__);
$content = $root . $ds . 'storage';
@zllovesuki
zllovesuki / request.php
Last active August 29, 2015 14:02
Cache Request
<?php
$website = 'http://yourwebsite.com'; //no trailing slash
$key = 'kokenwtf';
/*
*
* RUNNING ON A MACHINE THAT HAS UNLIMITED EXECUTION TIME IS HIGHLY ENCOURAGED
@zllovesuki
zllovesuki / settings.php
Created June 14, 2014 06:09
app/application/controllers/settings.php
<?php
class Settings extends Koken_Controller {
function __construct()
{
parent::__construct();
}
function index()
<?php
require_once(dirname(__FILE__) . '/icc.php');
class Darkroom {
public static $presets = array(
'tiny' => array(
'width' => 60,
'height' => 60
@zllovesuki
zllovesuki / convert.php
Created June 16, 2014 06:07
cp commands generator
<?php
$string = 'put
the
ldd /path/to/convert
results
in
here';
$array = explode("\n", $string);
@zllovesuki
zllovesuki / website1.conf
Created June 16, 2014 06:11
/etc/php-fpm.d/website1.conf
[website1]
prefix = /home/dir
listen = var/fcgi/php.sock
listen.backlog = -1
listen.allowed_clients = 127.0.0.1
listen.mode = 0666
user = tony
@zllovesuki
zllovesuki / website1.conf
Created June 16, 2014 06:15
/etc/nginx/site-enabled/website1.conf
server {
listen 80;
server_name example.tld;
root /home/dir/web;
access_log /home/dir/var/log/nginx_access.log;
error_log /home/dir/var/log/nginx_error.log error;
location ~ \.php$ {
try_files $uri =404;
<?php
$_SERVER['DOCUMENT_ROOT'] = ini_get('doc_root');
$_SERVER['SCRIPT_FILENAME'] = str_replace($_SERVER['HOME'], '', $_SERVER['SCRIPT_FILENAME']);
@zllovesuki
zllovesuki / Objects.java
Last active October 5, 2019 05:37
Interface Example
public interface MovableObject {
void move();
}
public abstract class Animal implements MovableObject {
abstract public void walk();
}
public class Human extends Animal {
@Override