-
In your local_settings.py file:
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'django_%s' % (PROJECT_NAME,),
'USER': xxxx,
<?php | |
/** | |
* Tests if the current request is an AJAX request by checking the X-Requested-With HTTP | |
* request header that most popular JS frameworks now set for AJAX calls. | |
* | |
* @return boolean | |
*/ | |
function is_ajax() | |
{ | |
return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest'); |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
# ************************************************************ | |
# Sequel Pro SQL dump | |
# Version 3408 | |
# | |
# http://www.sequelpro.com/ | |
# http://code.google.com/p/sequel-pro/ | |
# | |
# Host: 127.0.0.1 (MySQL 5.1.44) | |
# Database: blog_tests | |
# Generation Time: 2011-10-08 18:00:24 +0200 |
<?php | |
/** | |
* YouTube Preg Match Test Case. | |
* | |
* @author Mario "Kuroir" Ricalde | |
*/ | |
// Regular Expression (the magic). | |
$youtube_regexp = "/^http:\/\/(?:www\.)?(?:youtube.com|youtu.be)\/(?:watch\?(?=.*v=([\w\-]+))(?:\S+)?|([\w\-]+))$/"; |
<?php | |
// Change /*CUSTOMIZE_THIS*/ to a unique name (two places). Go ahead, make it long. | |
// Like, your initials, and your full plugin name. | |
// e.g. MTJ_Some_Awesome_Plugin_Controller | |
/*CUSTOMIZE_THIS*/_Controller::init(); | |
class /*CUSTOMIZE_THIS*/_Controller { | |
function init() { |
# add to | |
functions.php | |
// This theme uses post thumbnails | |
add_theme_support( 'post-thumbnails' ); | |
set_post_thumbnail_size( 300, 300, true ); | |
add_image_size( 'thumbnail-small', 75, 9999 ); | |
add_image_size( 'thumbnail-medium', 500, 9999 ); | |