This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?PHP | |
$WP_NONQUOTED_POST = array(); | |
/** | |
* Add magic quotes to $_GET, $_POST, $_COOKIE, and $_SERVER. | |
* | |
* Also forces $_REQUEST to be $_GET + $_POST. If $_SERVER, $_COOKIE, | |
* or $_ENV are needed, use those superglobals directly. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Public domain | |
# Created by Jari Pennanen | |
# September 2011 | |
# | |
# For viewing SQLite, try one of these | |
# - http://sqliteadmin.orbmu2k.de/ (only win32, better than sqlitebrowser) | |
# - http://sqlitebrowser.sourceforge.net/ | |
import sqlite3 | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var parseURIMatcher = /^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/; | |
/** | |
* Parses the URI | |
* | |
* @param url | |
* @returns object | |
*/ | |
function parseURI(url) { | |
var m = parseURIMatcher.exec(url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?PHP | |
function post_order_type_default_sorting(&$query) { | |
if (!isset($query->query['orderby'])) { | |
$query->set('orderby', 'menu_order'); | |
} | |
} | |
function post_order_type_list_view() { | |
add_action('pre_get_posts', 'post_order_type_default_sorting', 1, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?PHP | |
abstract class My_AdminList { | |
public static $taxonomies = array("menu_category"); | |
public static $post_types = array("owns_restaurant_item"); | |
/** | |
* Admin init hook | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Select test</title> | |
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
function Hae(kohde_id, porras_id, kerros_id, fill_name) { | |
$.getJSON("hae_data2.php",{kohde_id: kohde_id, porras_id: porras_id, kerros_id: kerros_id}, function(j){ | |
console.log(j); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Edit User StyleSheet of Chrome: | |
Windows: | |
C:\Users\YOURUSERNAME\AppData\Local\Google\Chrome\User Data\Default\User StyleSheets\Custom.css | |
Create the file if it does not exist. Similar file is in Firefox too. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* http://plugins.jquery.com/project/query-object | |
* jQuery.query - Query String Modification and Creation for jQuery | |
* Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com) | |
* Licensed under the WTFPL (http://sam.zoy.org/wtfpl/). | |
* Date: 2009/8/13 | |
* | |
* @author Blair Mitchelmore | |
* @version 2.1.8 (fork) | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function date_i18n(format, timestamp) { | |
// http://kevin.vanzonneveld.net | |
// + original by: Carlos R. L. Rodrigues (http://www.jsfromhell.com) | |
// + parts by: Peter-Paul Koch (http://www.quirksmode.org/js/beat.html) | |
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) | |
// + improved by: MeEtc (http://yass.meetcweb.com) | |
// + improved by: Brad Touesnard | |
// + improved by: Tim Wiel | |
// + improved by: Bryan Elliott | |
// + improved by: David Randall |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Unique ID alpha numeric (0-9a-z) | |
* | |
* @return 20 character alphanumeric unique id | |
**/ | |
function getUID($id=null) { | |
$s = uniqid('', true); | |
$hex = substr($s, 0, 13); | |
$dec = $s[13] . substr($s, 15); // skip the dot |