This file contains hidden or 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 gettext | |
import locale | |
import logging | |
def init_localization(): | |
'''prepare l10n''' | |
locale.setlocale(locale.LC_ALL, '') # use user's preferred locale | |
# take first two characters of country code | |
loc = locale.getlocale() | |
filename = "res/messages_%s.mo" % locale.getlocale()[0][0:2] |
This file contains hidden or 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 queue = function() { | |
var tasks; | |
return { | |
start: function( list ) { | |
tasks = list; | |
first = tasks.pop(); | |
first(); | |
}, |
This file contains hidden or 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 | |
$_start = 0; | |
$_subdata = ''; | |
function profile_start() { | |
global $profile; | |
if ( $profile ) { | |
global $_start, $_subdata; | |
$_start = microtime(true); | |
$_subdata = ''; |