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 { | |
proxy_cache_path /var/nginx_cache/mycache levels=1:2 keys_zone=MYCACHE:5m inactive=12h max_size=20m; | |
# The config is even for the non-www host later you will see how we manage the redirect | |
server_name www.mysite.it mysite.it; | |
listen 111.222.333.444:80; | |
access_log /var/log/nginx/nginx.mysite_it.log upstream; | |
proxy_redirect off; |
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 | |
BACKUP="/path/to/temp/dir/$$" | |
DAY=$(date +"%a") | |
### MySQL Setup ### | |
MUSER="root" | |
MPASS="your_root_password" | |
MHOST="localhost" |
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
{ | |
"name": "symfony/framework-standard-edition", | |
"description": "The \"Symfony Standard Edition\" distribution", | |
"autoload": { | |
"psr-0": { "": "src/" } | |
}, | |
"require": { | |
"php": ">=5.3.3", | |
"symfony/symfony": "2.1.*", | |
"doctrine/orm": ">=2.2.3,<2.4-dev", |
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
Loading composer repositories with package information | |
Installing dependencies | |
Your requirements could not be resolved to an installable set of packages. | |
Problem 1 | |
- Installation request for symfony/assetic-bundle dev-master -> satisfiable by symfony/assetic-bundle dev-master. | |
- symfony/assetic-bundle dev-master requires kriswallsmith/assetic 1.1.* -> no matching package found. | |
Problem 2 | |
- Installation request for sensio/distribution-bundle dev-master -> satisfiable by sensio/distribution-bundle dev-master. | |
- sensio/distribution-bundle dev-master requires symfony/framework-bundle 2.2.* -> no matching package found. |
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
{ | |
"name": "symfony/framework-standard-edition", | |
"description": "My default SF2.1 project", | |
"autoload": { | |
"psr-0": { "": "src/" } | |
}, | |
"require": { | |
"php": ">=5.3.3", | |
"symfony/symfony": "2.1.*", | |
"doctrine/orm": ">=2.2.3,<2.4-dev", |
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
{% block collection_widget %} | |
{% spaceless %} | |
{# | |
Inspired by: | |
https://groups.google.com/forum/?fromgroups=#!topic/symfony2/onor9uFte9E | |
https://gist.github.com/1294186 | |
#} | |
{% if prototype is defined %} |
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 | |
$ch = curl_init("http://assetic.servergrove.com/yuicompressor.json"); | |
$encoded = "charset=UTF-8&in=%2Ftmp%2FYUI-IN-YdSk7U&out=%2Ftmp%2FYUI-OUT-AzeVJU&type=css&content=%23mapCanvas+img+%7B%0A++max-width%3A+none%3B%0A%7D%0A%0Abody+%7B%0A++padding-top%3A+90px%3B%0A%7D%0A"; | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $encoded); | |
curl_setopt($ch, CURLOPT_POST, 1); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$output = curl_exec($ch); | |
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
hpatoio@namazu:~$ mysqldump -uroot -p DATABASE_NAME -T '/home/simone/export_csv' --fields-terminated-by "," --fields-enclosed-by '"' --lines-terminated-by "\n" |
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
hpatoio@namazu:~$ mysql -uroot -h HOSTNAME -p DATABASE_NAME -B -e "select field1,field2 ... fieldX from \`TABLE_NAME\`;" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > my_export.csv |
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
shiftDay = 10 | |
var myDate = new Date(); | |
myDate.setDate(myDate.getUTCDate() + shiftDay) | |
day = myDate.getUTCDate() | |
month = myDate.getUTCMonth()*1 + 1 | |
year = myDate.getUTCFullYear() |
OlderNewer