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
location ~ ^/~(.+?)/(.+?\.php)$ { | |
root /home/$1/www/$2; | |
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
location ~ ^/~(.+?)(/.*)?$ { | |
alias /home/$1/www$2; | |
} |
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
require 'irb/completion' | |
require 'wirble' | |
IRB.conf[:AUTO_INDENT] = true | |
IRB.conf[:USE_READLINE] = true | |
Wirble.init | |
Wirble.colorize |
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
$.ajax({ | |
method: 'GET', | |
url: '/search.json', | |
data: 'q=' + escape(_mq_input.val()), | |
traditional: true, | |
dataType: 'json', // response's | |
complete: function(xhr, status) { | |
if (xhr.getResponseHeader('content-type') || '' == 'application/json') | |
var data = JSON.parse(xhr.responseText); | |
if ((status == 'success' || status == 'notmodified') && data['status'] == 'OK') { |
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
# Problema: | |
module Foo | |
@hello = 42 | |
class Bar | |
# Desde acá quiero llegar a @hello. | |
end | |
end |
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
# NOTE: I have no reason for indenting this like I do. | |
# But writing scrappers can get boring sometimes, you know. | |
# -^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^ | |
foo = un(first_or_value(tr.select('//*[preceding-sibling::font/a[contains(., "Bajar")]]'))) | |
# -^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^ | |
if 'nominal' in foo: l.add_value('tipo', 'nominal') | |
elif 'numerica' in foo: l.add_value('tipo', 'numerica') | |
else : raise ValueError(u'Not "nominal" nor "numerica" in %s' % foo) | |
# -^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^-^v^ |
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
In [313]: rx = r'(.*?), *(.*?[%(uni_az)s])([%(uni_AZ)s].*?[%(uni_az)s](?=[%(uni_AZ)s]))(.*)' % { | |
.....: 'uni_AZ': u"A-ZÑÀÁÄÂÉÈËÊÍÌÏÎÓÒÖÔÚÙÜÛ", | |
.....: 'uni_az': u"a-zñàáäâéèëêíìïîóòöôúùüû" } | |
In [314]: w = u'FOO, Bar BaSomewhere ÖverÉloh Rainbow' | |
In [315]: re.match(rx, w).groups() | |
Out[315]: (u'FOO', u'Bar Ba', u'Somewhere \xd6ver', u'\xc9loh Rainbow') |
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
headers.update({ # Vertical alignment pleases my mind. | |
'acta_num' : int(d['acta_num']), | |
'ult_mod_ver' : int(d['ult_mod_ver']) # WTF is this? | |
'mayoria_base' : un(d['mayoria_base']).lower(), | |
'mayoria_tipo' : un(d['mayoria_tipo']).lower(), | |
'miembros_total' : int(d['miembros_total']), | |
'presidente_apellido' : d['presidente_apellido'].title(), | |
'presidente_nombre' : d['presidente_nombre'].title(), | |
'quorum_tipo' : un(d['quorum_tipo']), | |
'resultado' : VOTE_RESULTS[d['resultado']] }) |
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
#!/usr/bin/env python | |
# coding: utf-8 | |
# Copyright (c) 2010, Renzo Carbonara <[email protected]> | |
# 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 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
#!/usr/bin/env python | |
# coding: utf-8 | |
# Copyright (c) 2011, Renzo Carbonara <[email protected]> | |
# 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 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"?> | |
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
<fontconfig> | |
<match target="font"> | |
<test name="family"> | |
<string>Monaco</string> | |
</test> | |
<edit name="autohint" mode="assign"> | |
<bool>true</bool> | |
</edit> |