Skip to content

Instantly share code, notes, and snippets.

View Larceniii's full-sized avatar
💭
Retro Text News

Green Larceniii

💭
Retro Text News
View GitHub Profile
diff --git a/wp-content/plugins/hyper-cache/options.php b/wp-content/plugins/hyper-cache/options.php
index 9daa572..cbc1e7e 100644
--- a/wp-content/plugins/hyper-cache/options.php
+++ b/wp-content/plugins/hyper-cache/options.php
@@ -1,6 +1,6 @@
<?php
-$options = get_option('hyper');
+$options = hyper_get_options();
Index: domain_mapping.php
===================================================================
--- domain_mapping.php (revision 646767)
+++ domain_mapping.php (working copy)
@@ -519,6 +519,10 @@
}
function domain_mapping_siteurl( $setting ) {
+ // Don't redirect customizer requests
+ if ( isset( $_SERVER['HTTP_REFERER'] ) && false !== strpos( $_SERVER['HTTP_REFERER'], 'wp-admin/customize.php' ) )
<?php /* Copyright(c) 2013 Robert Maupin. Released under the ZLIB License. */
if(count($_FILES) > 0) {
extract($_FILES['file']);
list($w,$h,$type)=getimagesize($tmp_name);
/*see exif-imagetype() documentation :) */
if(!$type||$type>3||filesize($tmp_name)>1024*200)
exit();
$ext=image_type_to_extension($type,false);
$md5=md5_file($tmp_name);
move_uploaded_file($tmp_name,$n="img/$md5.$ext");
<?php /* Copyright(c) 2013 Robert Maupin. Released under the ZLIB License. */
date_default_timezone_set('GMT');
define('DB','chan.db');
$max_image_size_kb = 1024*1024;
$thumbnail_size = 150;
$thumbnail_quality = 70;
$db = new PDO('sqlite:'.DB, 0, 0, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
function query($sql, $params = NULL) {
global $db;
$s = $db->prepare($sql);
@Larceniii
Larceniii / byobuCommands
Created October 13, 2015 16:30 — forked from jshaw/byobuCommands
Byobu Commands
Byobu Commands
==============
byobu Screen manager
Level 0 Commands (Quick Start)
------------------------------
<F2> Create a new window
@Larceniii
Larceniii / number-pad-zero.js
Created June 22, 2018 21:08 — forked from endel/number-pad-zero.js
Simplest way for leading zero padding in JavaScript
Number.prototype.pad = function(size) {
var s = String(this);
while (s.length < (size || 2)) {s = "0" + s;}
return s;
}
(1).pad(3) // => "001"
(10).pad(3) // => "010"
(100).pad(3) // => "100"