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
@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"
@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 / designer.html
Created January 2, 2015 17:46
designer
<link rel="import" href="../chart-js/chart-js.html">
<link rel="import" href="../google-map/google-map-search.html">
<link rel="import" href="../google-map/google-map-directions.html">
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
<template>
<style>
:host {
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@Larceniii
Larceniii / designer.html
Last active August 29, 2015 14:04
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../pp-barcode/pp-barcode.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@Larceniii
Larceniii / designer.html
Last active August 29, 2015 14:03
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
<?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);
<?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");
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' ) )