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
# in case of conflict with local nginx: | |
# make sure in all *.confs ( | |
# also in default and example to avoid error like | |
# 'nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)' | |
# ) | |
# set for instance "listen 127.0.0.1:80" instead of "listen *:80" | |
# docker & network settings | |
DOCKER_IMAGE_NAME="maxexcloo/nginx-php" # build of nginx-php - for example | |
DOCKER_CONTAINERS_NAME="nginx_bridged" # our container's name |
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; | |
server_name ntest.dev www.ntest.dev; | |
client_max_body_size 1m; | |
access_log /var/log/nginx/ntest.dev.access.log; | |
error_log /var/log/nginx/ntest.dev.error.log; | |
root /var/www/ntest.dev; | |
location / { | |
try_files $uri $uri/ index.php /index.php$is_args$args; |
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
alias ra='sudo service apache2 restart' | |
alias composer='php ~/composer.phar' | |
alias ssh1='ssh -p65035 andrey@192.168.1.3' | |
alias phpx="php -d xdebug.remote_autostart=1 -d xdebug.remote_host=192.168.1.88" | |
sshfs -p 65035 andrey@192.168.1.3:/ ~/Desktop/sftp | |
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting | |
# for xdebug remote |
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 | |
// mysql_real_escape_string requires an active mysql connection | |
function mysqlPrepareStr($str) { | |
return "'". str_replace( | |
array( '\\', "\0", "\n", "\r", "'", '"', "\x1a" ), | |
array( '\\\\', '\\0', '\\n', '\\r', "\\'", '\\"', '\\Z' ), | |
$str ) . "'"; | |
} |
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 | |
/** | |
* Determine csv delimiter | |
* | |
* @param resource $fileHandle - handle of csv file | |
* @return string - correct delimiter of csv file | |
*/ | |
function determineCsvDelimiter($fileHandle) | |
{ |
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 cp1251_to_utf8 ($txt) { | |
$in_arr = array ( | |
chr(208), chr(192), chr(193), chr(194), | |
chr(195), chr(196), chr(197), chr(168), | |
chr(198), chr(199), chr(200), chr(201), | |
chr(202), chr(203), chr(204), chr(205), | |
chr(206), chr(207), chr(209), chr(210), |
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
/usr/share/debconf/fix_db.pl | |
sudo dpkg --configure -a |
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 | |
$entityClassNames = $doctrine->em->getConfiguration() | |
->getMetadataDriverImpl() | |
->getAllClassNames(); |
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 -ev | |
git remote rm origin || true | |
git branch -D in || true | |
( | |
cd .git | |
rm -rf refs/remotes/ refs/original/ *_HEAD logs/ | |
) | |
git for-each-ref --format="%(refname)" refs/original/ | xargs -n1 --no-run-if-empty git update-ref -d | |
git -c gc.reflogExpire=0 -c gc.reflogExpireUnreachable=0 -c gc.rerereresolved=0 -c gc.rerereunresolved=0 -c gc.pruneExpire=now gc "$@" |
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
# all downloaded verions of IDE has English localization, so add to ~/netbeans-8.0/etc/netbeans.conf | |
netbeans_default_options="-J-Duser.language=en -J-Duser.region=US" |