Using Homebrew install mailhog
and enable the service as instructed in the installation.
Open in any browser http://localhost:8025
Edit file /etc/postfix/main.cf
sudo vim /etc/postfix/main.cf
if [ $# -eq 0 ] | |
then | |
echo "No arguments supplied" | |
else | |
mysql -uroot --execute="CREATE DATABASE $1 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" | |
fi |
# backup files from a docker volume into /tmp/backup.tar.gz | |
# from http://stackoverflow.com/questions/21597463/how-to-port-data-only-volumes-from-one-host-to-another | |
function docker-volume-backup-compressed() { | |
docker run --rm -v /tmp:/backup --volumes-from "$1" debian:jessie tar -czvf /backup/backup.tar.gz "${@:2}" | |
} | |
# restore files from /tmp/backup.tar.gz into a docker volume | |
function docker-volume-restore-compressed() { | |
docker run --rm -v /tmp:/backup --volumes-from "$1" debian:jessie tar -xzvf /backup/backup.tar.gz "${@:2}" | |
echo "Double checking files..." | |
docker run --rm -v /tmp:/backup --volumes-from "$1" debian:jessie ls -lh "${@:2}" |
#include <stdio.h> | |
#include <string.h> | |
#include <math.h> | |
#include <stdlib.h> | |
int solveMeFirst(int a, int b) { | |
return a+b; | |
} | |
int main() { | |
int num1,num2; |
SELECT SUM(TABLE_ROWS) FROM `information_schema`.`tables` WHERE `table_schema` = 'your_database_name'; |
<?php | |
// ... | |
# using a Heroku Postgresql DB | |
$heroku_db_url = parse_url($_ENV['DATABASE_URL']); | |
$databases['default']['default'] = array( | |
'driver' => 'pgsql', | |
'database' => substr($heroku_db_url['path'], 1), | |
'username' => $heroku_db_url['user'], | |
'password' => $heroku_db_url['pass'], |
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresDefault "access plus 1 year" | |
ExpiresByType text/html "access plus 300 seconds" | |
ExpiresByType text/css "access plus 1 year" | |
ExpiresByType application/javascript "access plus 1 year" | |
ExpiresByType audio/ogg "access plus 1 year" | |
ExpiresByType image/gif "access plus 1 year" | |
ExpiresByType image/jpeg "access plus 1 year" | |
ExpiresByType image/png "access plus 1 year" |
<?php | |
/** | |
* Implements hook_views_query_alter() | |
*/ | |
function views_pager_mod_views_pre_execute(&$view) { | |
// some data to be used | |
$query_params = drupal_get_query_parameters(); |
#!/bin/bash | |
# thanks http://www.jenssegers.be/blog/46/deploying-websites-with-git-and-composer- | |
# replace folder | |
cd "`dirname $0`/../../application/config" | |
# Check if a composer.json file is present | |
if [ -f composer.json ]; then |
# Created by https://www.gitignore.io/api/wordpress | |
### WordPress ### | |
*.log | |
wp-config.php | |
wp-content/advanced-cache.php | |
wp-content/backup-db/ | |
wp-content/backups/ | |
wp-content/blogs.dir/ | |
wp-content/cache/ |
Using Homebrew install mailhog
and enable the service as instructed in the installation.
Open in any browser http://localhost:8025
Edit file /etc/postfix/main.cf
sudo vim /etc/postfix/main.cf