Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| CREATE TABLE IF NOT EXISTS `country` ( | |
| `id` int(11) NOT NULL AUTO_INCREMENT, | |
| `iso` char(2) NOT NULL, | |
| `name` varchar(80) NOT NULL, | |
| `nicename` varchar(80) NOT NULL, | |
| `iso3` char(3) DEFAULT NULL, | |
| `numcode` smallint(6) DEFAULT NULL, | |
| `phonecode` int(5) NOT NULL, | |
| PRIMARY KEY (`id`) | |
| ) ENGINE=MyISAM DEFAULT CHARSET=latin1; |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
#Techniques for Anti-Aliasing @font-face on Windows
It all started with an email from a client: Do these fonts look funky to you? The title is prickly.
The font in question was Port Lligat Sans from Google Web Fonts.
| <?php | |
| /** | |
| * @author Kanstantsin A Kamkou (2ka.by) | |
| * History: | |
| * - 21.08.2012 Bootstrap 2.1.0 corrections | |
| * - 31.03.2013 Acl check added | |
| */ | |
| $html = array('<ul class="nav">'); |
| def run_pg_fouine(): | |
| info = host_info[env.host_string] | |
| db_name = info.tags.get('Name') | |
| sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 0/" /etc/postgresql/9.*/main/postgresql.conf') | |
| sudo('/etc/init.d/postgresql reload') | |
| time.sleep(30) | |
| sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 500/" /etc/postgresql/9.*/main/postgresql.conf') | |
| sudo('/etc/init.d/postgresql reload') | |
| run('tail -n 100000 /var/log/postgresql/postgresql-9.*-main.log > /tmp/pgfouine.txt') | |
| run('gzip -f /tmp/pgfouine.txt') |
| <?php | |
| // Snippet for Symfony 2 application that uses Doctrine 2 to handle transactions | |
| // It uses the names of the objects/doctrine repositories from the Beta 4 Manual of Symfony 2. | |
| // Get the entity manager | |
| $em = $this->getDoctrine()->getEntityManager(); | |
| // suspend auto-commit | |
| $em->getConnection()->beginTransaction(); |
| <?php | |
| /** | |
| * Copyright (c) 2007, Roger Veciana | |
| * 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 |
| username: vagrant | |
| password: vagrant | |
| sudo apt-get update | |
| sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev | |
| sudo aptitude install mysql-server mysql-client | |
| sudo nano /etc/mysql/my.cnf |
| <?php | |
| echo slug('João Batista Neto'); //joao-batista-neto |
| // using: https://github.com/igorescobar/jQuery-Mask-Plugin | |
| // version: v0.5.0+ | |
| var SPphoneMask = function(phone, e, currentField, options){ | |
| return phone.match(/^(\(?11\)? ?9(5[0-9]|6[0-9]|7[01234569]|8[0-9]|9[0-9])[0-9]{1})/g) ? '(00) 00000-0000' : '(00) 0000-0000'; | |
| }; | |
| $(".sp_celphones").mask(SPphoneMask, {onKeyPress: function(phone, e, currentField, options){ | |
| $(currentField).mask(SPphoneMask(phone), options); | |
| }}); |