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
но самое главное - сначала мейкнуть ImageMagick из исходников, а потом уже ставить rmagick. Если не будет ставиться, то поставить лабуду ниже. | |
sudo apt-get install libmagickwand-dev | |
sudo apt-get install libmagickwand-dev imagemagick | |
sudo apt-get install imagemagick libmagickcore-dev | |
./configure --disable-static --with-modules --without-perl --without-magick-plus-plus --enable-shared=yes --with-jpeg=yes --with-png=yes --with-tiff=yes | |
apt-get install graphicsmagick-libmagick-dev-compat |
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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
/** | |
* MY_Form_validation Class works with predefined input params: | |
* @example | |
* $params = $this->get(); | |
* if($this->form_validation->run("do_something", $params)) { | |
* //do something | |
* } else throw new Exception(validation_errors()); |
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" |
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
<?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
/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 | |
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
<?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 | |
// 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
alias ra='sudo service apache2 restart' | |
alias composer='php ~/composer.phar' | |
alias ssh1='ssh -p65035 [email protected]' | |
alias phpx="php -d xdebug.remote_autostart=1 -d xdebug.remote_host=192.168.1.88" | |
sshfs -p 65035 [email protected]:/ ~/Desktop/sftp | |
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting | |
# for xdebug remote |
OlderNewer