$ git config --global -e
[merge]
keepBackup = false;
tool = p4merge
[mergetool "p4merge"]
cmd = p4merge "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
keepTemporaries = false
| #!/bin/bash | |
| # PHP CodeSniffer pre-commit hook for git | |
| # | |
| # @author Soenke Ruempler <soenke@ruempler.eu> | |
| # @author Sebastian Kaspari <s.kaspari@googlemail.com> | |
| # | |
| # see the README | |
| PHPCS_BIN=/usr/bin/phpcs | |
| PHPCS_CODING_STANDARD=PEAR |
Goal: Connect to MSSQL using FreeTDS / ODBC in Python.
Host: Ubuntu 11.10 x86_64
Install:
sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy
In /etc/odbcinst.ini:
| class CacheBaseHandler(tornado.web.RequestHandler): | |
| def prepare(self): | |
| cached = self.application.db.cache.find_one({"slug": self.request.path}) | |
| if cached is not None: | |
| self.write(cached["content"]) | |
| self.finish() | |
| def render_string(self, template_name, **kwargs): | |
| html_generated = \ |
| public class DateTools { | |
| private final static TimeZone GMT = TimeZone.getTimeZone("GMT"); | |
| private static final SimpleDateFormat YEAR_FORMAT = new SimpleDateFormat("yyyy", Locale.US); | |
| private static final SimpleDateFormat MONTH_FORMAT = new SimpleDateFormat("yyyyMM", Locale.US); | |
| private static final SimpleDateFormat DAY_FORMAT = new SimpleDateFormat("yyyyMMdd", Locale.US); | |
| private static final SimpleDateFormat HOUR_FORMAT = new SimpleDateFormat("yyyyMMddHH", Locale.US); | |
| private static final SimpleDateFormat MINUTE_FORMAT = new SimpleDateFormat("yyyyMMddHHmm", Locale.US); | |
| private static final SimpleDateFormat SECOND_FORMAT = new SimpleDateFormat("yyyyMMddHHmmss", Locale.US); |
| <?php | |
| // A query without any settings will use default values. | |
| // This will result in a "*:*" query, 10 rows, all fields. | |
| $query = new Solarium_Query_Select; | |
| $result = $client->select($query); | |
| echo 'Number of results found: ' . $result->getNumFound(); | |
| // The resultset is iterable, you could also use $result->getDocuments() to get an array with documents. |
Prereq:
apt-get install zsh
apt-get install git-coreGetting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
| ############################################# | |
| # Push de la rama actual | |
| git push origin $rama_actual | |
| ############################################# | |
| # Volver a un commit anterior, descartando los cambios | |
| git reset --HARD $SHA1 | |
| ############################################# | |
| # Ver y descargar Ramas remotas |
| [unix_http_server] | |
| file=/tmp/supervisor.sock ; path to your socket file | |
| [supervisord] | |
| logfile=/var/log/supervisord/supervisord.log ; supervisord log file | |
| logfile_maxbytes=50MB ; maximum size of logfile before rotation | |
| logfile_backups=10 ; number of backed up logfiles | |
| loglevel=error ; info, debug, warn, trace | |
| pidfile=/var/run/supervisord.pid ; pidfile location | |
| nodaemon=false ; run supervisord as a daemon |