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
{% if paginator.count %} | |
<div class="pagination clearfix"> | |
<span class="results-count">{{ paginator.count }} {% trans 'results' %}</span> | |
<span class="paginator"> | |
{% if page.has_previous %} | |
<a title="previous page" class="prev awesome medium button" | |
href="?{{ search_qs }}&page={{ page.previous_page_number }}&{{ form.previous_facets_encoded }}"> | |
| |
</a> | |
{% endif %} |
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
#!/sbin/runscript | |
# Copyright 1999-2005 Gentoo Foundation | |
# Distributed under the terms of the GNU General Public License v2 | |
opts="${opts} " | |
pidfile="/var/run/supervisord/supervisord.pid" | |
fromcron="0" | |
# this next comment is important, don't remove it - it has to be somewhere in | |
# the init script to kill off a warning that doesn't apply to us |
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
>>> import tweepy | |
>>> auth = tweepy.BasicAuthHandler("matagus", "blablabla") | |
>>> api = tweepy.API(auth) | |
>>> user = tweepy.api.get_user('twitter') | |
>>> user | |
<tweepy.models.User object at 0xb767b88c> | |
>>> user.id_str | |
u'783214' | |
>>> user = tweepy.api.get_user('matagus') | |
>>> user.id_str |
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: https://gist.github.com/605541#file_js_web_worker_pool.js | |
// Web Worker Pool | |
// size is the max number of arguments | |
function WorkerPool(size) { | |
var workers = 0, | |
jobs = []; | |
// url: the url of the worker script | |
// msg: the initial message to pass to the worker | |
// cb : the callback to recieve messages from postMessage. |
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 data = (function () { | |
var _data = []; | |
$("#<TABLE-ID-REPLACE-ME> tbody td").each( | |
function () { | |
var rowIndex = this.parentNode.rowIndex -1, | |
cellValue = this.innerHTML.trim(); | |
if (_data[rowIndex]) { | |
_data[rowIndex].push(cellValue); | |
} else { | |
_data[rowIndex] = [cellValue]; |
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
""" | |
Copyright (c) 2009, Sean Creeley | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without modification, | |
are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright notice, this | |
list of conditions and the following disclaimer. | |
* Redistributions in binary form must reproduce the above copyright notice, |
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
# -*- coding: UTF-8 -*- | |
from pika import PlainCredentials, ConnectionParameters, BasicProperties | |
from pika.adapters import BlockingConnection | |
from django.conf import settings | |
credentials = PlainCredentials( | |
settings.RABBIT["userid"], settings.RABBIT["password"]) | |
parameters = ConnectionParameters(credentials=credentials, |
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
-- this a single line comment | |
-- | |
{- and this | |
- is a multiline | |
- comment | |
- in haskell code -} | |
a = "my string" | |
b = ['m', 'y', 's', 't', 'i', 'n', 'g'] |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<hen:logs xmlns:hen="http://www.site.de/schemas/logs/1.0"> | |
<!--<hen:vhost> | |
<hen:uuid></hen:uuid> | |
</hen:vhost>--> | |
<hen:vhost>www.site1.de | |
<hen:uuid>c5328180-e52b-4af5-bf6e-7a9e7c1754e2</hen:uuid> | |
</hen:vhost> | |
<hen:vhost>www.site2.de | |
<hen:uuid>b7b968db-27c7-4430-8346-b2c6e2de8065</hen:uuid> |
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: http://groups.google.com/group/modwsgi/browse_thread/thread/f289c8167923aab7 | |
The problem with Django is that there are certain circumstances where | |
it will hide the actual error message and traceback and replace it | |
will a higher level exception, but with the traceback then being where | |
that higher level exception was raised. This is one such case. | |
To try and find the real location of the exception add the following | |
to your WSGI script file. |