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
// your_search can be : A, M, D, ?? | |
git status -s | grep 'your_search' | awk '{print $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
sudo rm /etc/localtime | |
sudo ln -s /usr/share/zoneinfo/UTC /etc/localtime | |
# now check it's ok | |
$ date | |
lun déc 5 10:03:47 UTC 2011 |
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
#!/bin/sh | |
# Go in to the Geoip folder | |
cd /usr/share/GeoIP | |
# Download the new database of city | |
wget -N -q http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz | |
# Download the new database of country | |
wget -N -q http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz |
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
<?php | |
function good_indexes($sequence) { | |
$size_of_sequence = count($sequence); | |
$sum_lower_indexes = 0; | |
for ($i = 0; $i <= $size_of_sequence; $i++) | |
{ | |
if (!isset($sequence[$i])) | |
{ |
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
// do online schema change | |
$alter = "ALTER TABLE ".$tableName." ADD ".$description ."; | |
try { | |
$osc = new OnlineSchemaChange($sock, $user, $pwd, $db, null, $alter); | |
// Return true on success or false on failure | |
return $osc->execute(); | |
} catch (Exception $e) { |
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
{# Todo : Manage dropdown and search form #} | |
{% macro navbar(items, active, options) %} | |
{% set active = active|default('home') %} | |
{% set options = { | |
'fixed': '', | |
'divider': ''|default(false), | |
'brand': '' | |
}|merge(options|default({})) | |
%} |
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
# source http://stackoverflow.com/questions/5870188/does-flask-support-regular-expressions-in-its-url-routing | |
from flask import Flask | |
from werkzeug.routing import BaseConverter | |
app = Flask(__name__) | |
class RegexConverter(BaseConverter): | |
def __init__(self, url_map, *items): | |
super(RegexConverter, self).__init__(url_map) | |
self.regex = items[0] |
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
<?php | |
$zip = new ZipArchive(); | |
$t = $zip->open('MA.20130715-174538.ZIP'); | |
$fp = $zip->getStream('MA.XML'); | |
while (!feof($fp)) { | |
echo fread($fp, 4096); | |
} | |
fclose($fp); | |
$zip->close(); |
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
server { | |
listen 80; | |
root /var/www/example.com/web; | |
index index.php; | |
server_name example.com.dev; | |
access_log /var/log/nginx/$host.access.log; | |
error_log /var/log/nginx/$host.error.log; |
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
<?php | |
namespace Application\Migrations; | |
use Doctrine\DBAL\Migrations\AbstractMigration; | |
use Doctrine\DBAL\Schema\Schema; | |
class Version00000000000000 extends AbstractMigration | |
{ | |
public function up(Schema $schema) |
OlderNewer