View FindConflictingReferences.cs
1 2 3 4 5 6 7 8 9 10
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using NUnit.Framework;
namespace MyProject
{
[TestFixture]
View gist:2e8282ef7233e9467d89
1 2 3 4 5 6 7 8 9
# In myapp.tasks __init__.py
 
from celery import Celery
celery = Celery()
Task = celery.create_task_cls()
 
class MyBaseTask(Task):
abstract = True
# ...
View 00_destructuring.md

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors

View osx-for-hackers.sh
1 2 3 4 5 6 7 8 9 10
#!/bin/sh
 
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
 
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
View gist:80051359d9b65bb31c60

Hey! I saw this has been indexed by the search engines. It is a first draft of a post I ended up publishing on my blog at: Scaling PostgreSQL With Pgpool and PgBouncer

Thanks for stopping by!

PostgreSQL and Pgpool Architecture

View forms.html
1 2 3 4 5 6 7 8 9 10
{%- macro form_field_label(field) -%}
<label for="{{ field.id }}">{{ field.label.text }}
{%- if field.flags.required -%}
<abbr title="Diese Feld muss angegeben werden">*</abbr>
{%- endif %}</label>
{% endmacro %}
 
{%- macro form_field_description(field) -%}
{% if field.description %}
<span class="descr">{{ field.description }}</span>
View gist:d110912d195ec13b47af
1 2 3 4 5 6 7 8 9 10
@roles('broker', 'stressors')
def git_pull():
with cd("%s" % git_folder):
run("git pull")
 
 
@roles('stressors')
def restart_celeryd():
# NOT WORKING
sudo("supervisorctl restart all")
View countries.php
1 2 3 4 5 6 7 8 9 10
<?php
$countryArray = array(
'AD'=>array('name'=>'ANDORRA','code'=>'376'),
'AE'=>array('name'=>'UNITED ARAB EMIRATES','code'=>'971'),
'AF'=>array('name'=>'AFGHANISTAN','code'=>'93'),
'AG'=>array('name'=>'ANTIGUA AND BARBUDA','code'=>'1268'),
'AI'=>array('name'=>'ANGUILLA','code'=>'1264'),
'AL'=>array('name'=>'ALBANIA','code'=>'355'),
'AM'=>array('name'=>'ARMENIA','code'=>'374'),
'AN'=>array('name'=>'NETHERLANDS ANTILLES','code'=>'599'),
View routing.txt
1 2 3 4 5 6 7 8 9 10
We need a better syntax for routing. The dispatch list
is both too limited and too inconvenient.
 
This better syntax will be parsed and converted to a more
efficient form before it is used, therefore the complexity
of the parsing of the routes has no impact on performance.
 
We accept both strings and binaries.
 
First we can match normal paths.
View introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

Something went wrong with that request. Please try again.