This file contains hidden or 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
/* Without jQuery */ | |
/* Example | |
<input id="myInput" name='credit-card' value='' /> | |
*/ | |
document.getElementById('myInput').onkeyup = function() { | |
this.value = this.value.replace(/[^\d]/gi , ''); | |
}; |
This file contains hidden or 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 | |
$wQuery = new WP_Query( | |
array('post_type' => 'post', | |
'posts_per_page' => $how_many, | |
'cat' => '46,43', // categories should be supplied this way (an array doesn't work) | |
'meta_key' => 'post_views' , | |
'orderby' => 'meta_value_num', // or meta_value (if it's a string) | |
'order' => 'DESC') | |
); |
This file contains hidden or 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 | |
// checks file mime type, if it's a image. | |
if ( stristr($mime, "image/") === false)) return false; | |
?> |
This file contains hidden or 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 | |
/* | |
* | |
* Google Web Fonts PHP list | |
* This file has a list of all Google Web Fonts | |
* Note that it may not be up to date | |
* | |
*/ | |
$google_web_fonts = array(array('ABeeZee', 'regular,italic,'),array('Abel', 'regular,'),array('Abril Fatface', 'regular,'),array('Aclonica', 'regular,'),array('Acme', 'regular,'),array('Actor', 'regular,'),array('Adamina', 'regular,'),array('Advent Pro', '100,200,300,regular,500,600,700,'),array('Aguafina Script', 'regular,'),array('Akronim', 'regular,'),array('Aladin', 'regular,'),array('Aldrich', 'regular,'),array('Alegreya', 'regular,italic,700,700italic,900,900italic,'),array('Alegreya SC', 'regular,italic,700,700italic,900,900italic,'),array('Alex Brush', 'regular,'),array('Alfa Slab One', 'regular,'),array('Alice', 'regular,'),array('Alike', 'regular,'),array('Alike Angular', 'regular,'),array('Allan', 'regular,700,'),array('Allerta', 'regular,'),array('Allerta Stencil', 'regular,'),array('Allura', 'regular,'),array('Almendra', 'regular,italic,700,700italic,'),array('Al |
This file contains hidden or 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 | |
/* | |
Place this script inside the wp-content folder. | |
Any incoming request for image will be taken over if the requested file doesn't exist. | |
And will setup a .htacces file to take all incoming requests and send them to this file. | |
Run it once to setup. | |
Configure the constants below. | |
*/ | |
/* Setup Constants */ |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf8 -*- | |
# ========= EDIT HERE ====================================================== | |
config = { | |
# Set the save path | |
'save_path' : "C:\\VertrigoServ\\www", | |
'folder_name' : 'dezvoltare', | |
'title' : 'Dezvoltare', |
This file contains hidden or 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 | |
//https://raw.github.com/dongsheng/cURL/master/curl.class.php | |
require_once('curl_class.php'); | |
$request = array( | |
'blog_id' => 1, | |
'username' => 'username', | |
'password' => 'password', | |
'post_id' => 84 |
This file contains hidden or 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 | |
/** | |
* Slugger, simple logging class | |
* Writes logs into a file and sends them by e-mail once in a while | |
* Written for pure example | |
* @require PHP >= 5.3 | |
* @todo : Fix bug when the class is firt time instantiated it send an empty message | |
*/ | |
/* Don't forget to setup a date default timezone */ |
This file contains hidden or 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 | |
class Request { | |
public $curl_object; | |
public function __construct($p_username = "", $p_password = "", $p_timeout = 15) | |
{ | |
$this->curl_object = curl_init(); | |
curl_setopt($this->curl_object, CURLOPT_HTTPHEADER, Array("Accept: application/json", "Content-Type: application/json")); | |
curl_setopt($this->curl_object, CURLOPT_CONNECTTIMEOUT, $p_timeout); |
This file contains hidden or 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 | |
class Template { | |
static $escape = true; | |
static $template = ""; | |
static $vars = array(); | |
public static function sanitize($what) | |
{ | |
return filter_var($what, FILTER_SANITIZE_STRING); |
OlderNewer