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 | |
// See: http://blog.ircmaxell.com/2013/02/preventing-csrf-attacks.html | |
// Start a session (which should use cookies over HTTP only). | |
session_start(); | |
// Create a new CSRF token. | |
if (! isset($_SESSION['csrf_token'])) { | |
$_SESSION['csrf_token'] = base64_encode(openssl_random_pseudo_bytes(32)); | |
} |
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
var oauth = ChromeExOAuth.initBackgroundPage({ | |
'request_url': 'http://www.tumblr.com/oauth/request_token', | |
'authorize_url': 'http://www.tumblr.com/oauth/authorize', | |
'access_url': 'http://www.tumblr.com/oauth/access_token', | |
'consumer_key': 'vGKikr2uBRsWoDZ947UjvSzA58HYEXDNjAer7VEXnLXlQt4Ozi', | |
'consumer_secret': 'JvofKKxQ2QSiVXVaWMBZQRzC5cI86YpJzAoouIkUdlvSeYXN2e', | |
'app_name': 'Photo post adder' | |
}); | |
function stringify(parameters) { |
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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = array( |
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 | |
$elements = array(); | |
//// | |
// An array of 10,000 elements with random string values | |
//// | |
for($i = 0; $i < 10000; $i++) { | |
$elements[] = (string)rand(10000000, 99999999); | |
} |
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 | |
/* | |
Plugin Name: Feed Noticias Móviles | |
Plugin URI: http://www.udd.cl | |
Description: Crea un feed de noticias para consumo en aplicación móvil | |
Version: 0.1 | |
Author: Felipe Lavín (AyerViernes S.A.) | |
Author URI: http://www.ayerviernes.com | |
*/ |
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
//descriptions from http://www.lunametrics.com/blog/2011/10/04/utmgif-request-parameters/ | |
var utmwv = "5.3.8"; // Tracking code version | |
var utms = "1"; // Session requests. Updates every time a __utm.gif request is made. Stops incrementing at 500 (max number of GIF requests per session). | |
var utmn = "1797201820"; // Unique ID generated for each GIF request to prevent caching of the GIF image | |
var utmhn = "teammentor-33-ci"; // Host name, which is a URL-encoded string | |
var utmcs = "ISO-8859-1"; // Language encoding for the browser. Some browsers don’t set this, in which case it is set to “-” | |
var utmsr = "1440x852"; // Screen resolution | |
var utmvp = "1440x751"; // Size of Viewing Pane | |
var utmsc = "32-bit"; // Screen color depth | |
var utmul = "en-us"; // Browser language |
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
/** | |
* Simple localStorage with Cookie Fallback | |
* v.1.0.0 | |
* | |
* USAGE: | |
* ---------------------------------------- | |
* Set New / Modify: | |
* store('my_key', 'some_value'); | |
* | |
* Retrieve: |
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 | |
/** | |
* Customize Image Reloaded Class | |
* | |
* Extend WP_Customize_Image_Control allowing access to uploads made within | |
* the same context | |
*/ | |
class My_Customize_Image_Reloaded_Control extends WP_Customize_Image_Control { | |
/** | |
* Constructor. |
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
<a class="drop-down-toggle">Click me to reveal drop down box below...</a> | |
<div class="drop-down-wrapper"> | |
Hello, I will be revealed! | |
</div> |
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 | |
/** | |
* Setup wp_query arguments for the loop. Cache the results for 4 hours. | |
* | |
* @link http://codex.wordpress.org/Transients_API | |
*/ | |
// Check for transient | |
if ( false === ( $my_query = get_transient( 'foo_featured_posts' ) ) ) { | |