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 | |
// Run original query, exclude category (in our case 4) | |
query_posts( "showposts=40&cat=-4"); | |
$wp_query->get_posts(); // this will force the query to run | |
// Grab different data, in our case, data from our twitter category | |
$twitter = get_posts( "cat=4&showposts=3"); | |
// Then we insert posts into $wp_query->posts using a loop and splice |
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
on open current_files | |
repeat with current_file in current_files | |
-- validate if the file as a folder | |
if (current_file as string) ends with ":" then | |
try | |
set current_file_path to (POSIX path of the current_file as string) | |
do shell script "find '" & current_file_path & "' -name '.svn' | xargs rm -Rf" |
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 | |
// Create hook funktion that alters the sql. It takes two args. $where (the sql string) and $wp_query (which is the actual query and holds the args for the function, $beinDate and $endDate). | |
function posts_where_hook( $where = '', $wp_query ) | |
{ | |
$beginDate = $wp_query->get("beginDate"); | |
$endDate = $wp_query->get("endDate"); | |
$where .= " AND post_date >= '".$beginDate."' AND post_date < '".$endDate."'"; |
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://tentacles.posterous.com/using-django-debug-toolbar-with-piston | |
from piston.emitters import Emitter | |
from django.http import HttpResponse | |
from django.utils import simplejson | |
from django.core.serializers.json import DateTimeAwareJSONEncoder | |
class HTMLEmitter( Emitter ): | |
def render( self, request ): | |
data = self.construct() |
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
/* | |
* Project: | |
* Description: | |
* Author: | |
* License: | |
*/ | |
// the semi-colon before function invocation is a safety net against concatenated | |
// scripts and/or other plugins which may not be closed properly. | |
;(function ( $, window, undefined ) { |
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
from django import template | |
from django.template import Node, resolve_variable | |
from django.template.base import Variable | |
__author__ = 'martinsandstrom' | |
register = template.Library() | |
""" | |
This custom tag appends values onto a get var, with a delimiter. Like a list. |
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
/** | |
* $.parseParams - parse query string paramaters into an object. | |
*/ | |
/*jshint regexp: false */ | |
(function($) { | |
var re = /([^&=]+)=?([^&]*)/g; | |
var decodeRE = /\+/g; // Regex for replacing addition symbol with a space | |
var decode = function (str) { return decodeURIComponent( str.replace(decodeRE, " ") ); }; | |
$.parseParams = function(query) { | |
var params = {}, e; |
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
/** | |
* Licensed under the MIT License | |
* | |
* DryRun is a Backbone.js addon that allows you to trigger route handler by suppling a url segment. | |
* without effecting Backbone history. (For those rare occations.) | |
* | |
* Usage: | |
* var fragment = window.location.pathname.substr(1, window.location.pathname.length); | |
* Backbone.dryRun(fragment); | |
**/ |
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
from tastypie.exceptions import NotFound | |
from tastypie.resources import ModelResource | |
from tastypie.authentication import BasicAuthentication, ApiKeyAuthentication | |
from tastypie.models import ApiKey | |
from django.contrib.auth.models import User | |
__author__ = 'martinsandstrom' | |
class ApiTokenResource(ModelResource): |
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
__author__ = 'martinsandstrom' | |
""" | |
SOURCE: | |
Most of the sources come from: | |
http://torvpn.com/temporaryemail.html | |
USAGE: | |
import email_disposable |
OlderNewer