Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
<?php | |
with(new Page())->makeRoot(); | |
with(new Page())->makePreviousSiblingOf(Page::find(1)) | |
with(new Page())->makeNextSiblingOf(Page::find(1)) | |
with(new Page())->makeLastChildOf(Page::find(5)) | |
with(new Page())->makeFirstChildOf(Page::find(2)) | |
Page::find(2)->children() | |
Page::find(2)->parent() | |
Page::find(2)->sibling() | |
Page::find(2)->isDescendant(Page::find(3)) |
rsync (Everyone seems to like -z, but it is much slower for me)
... I couldn't resist the temptation for some pseudo-alliteration.
When it comes to driving, I'm a rather slow driver. I can parallel park with my eyes-closed, merge in traffic easily, but I really don't enjoy driving fast (Mind you, I take public transport these days). But when it comes to squeezing performance out of a system, I guess I'm much more attracted to the idea of things running fast. The redis attraction is therefore quite obvious. In-memory database. It doesn't get much faster than that.
It was rather surprising to come across speed issues with redis, and fairly early-on with our project. At kenHub, we are building an anatomy learning platform. The platform must adapt to each and every student, and present them with the best question for their level. To do this, we must store statistics for each and every anatomy term for each user. Redis was a natural candidate for this. Quick access to read/write individual records allows us to u
/* | |
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/ | |
* Better handling of scripts without supplied ids. | |
* | |
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function. | |
*/ | |
(function(doc, script) { | |
var js, | |
fjs = doc.getElementsByTagName(script)[0], |
<?php | |
/** | |
* A Nested Comments manager using Redis only | |
* @author Michel Bartz <[email protected]> | |
* @date 01/28/2011 | |
*/ | |
class Comments | |
{ | |
private $_redis; |
def simple_nested_set(clazz) # Post for example | |
stack = [] # Post for example | |
result = [] | |
clazz.all(:order => "lft").each do |node| | |
if stack.empty? | |
stack.push({:node => node, :children => []}) | |
result << stack.last | |
next | |
end | |
if stack.last[:node].lft < node.lft && node.lft < stack.last[:node].rgt |
import re | |
# http://atomboy.isa-geek.com/plone/Members/acoil/programing/double-metaphone | |
from metaphone import dm as double_metaphone | |
# get the Redis connection | |
from jellybean.core import redis | |
import models | |
# Words which should not be indexed |