View test_arrow_timezone.py
1 2 3 4 5 6 7 8 9
#!/usr/bin/env python3
"""Notes on `arrow` library.
* inconsitent (fixed)
>>> a = arrow.get(datetime(2012, 4, 7, 0, 30, 00), 'America/New_York')
>>> a.datetime.tzname() == a.tzinfo.tzname(a.datetime) # fixed
True
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
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'),
Something went wrong with that request. Please try again.