This file contains hidden or 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
{ | |
"require-dev": { | |
"squizlabs/php_codesniffer": "2.0.*@dev" | |
}, | |
"scripts": { | |
"post-install-cmd": [ | |
"bash contrib/setup.sh" | |
] | |
} | |
} |
This file contains hidden or 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
c_red='\[\e[31m\]' | |
c_bold_red='\[\e[31;1m\]' | |
c_white='\[\e[37m\]' | |
c_bold_white='\[\e[37;1m\]' | |
c_green='\[\e[32m\]' | |
c_bold_green='\[\e[32;1m\]' | |
c_lblue='\[\e[1;34m\]' | |
c_bold_lblue='\[\e[1;34;1m\]' | |
c_cyan='\[\e[36m\]' | |
c_bold_cyan='\[\e[36;1m\]' |
This file contains hidden or 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
sed '/^$/d' myFile > tt |
This file contains hidden or 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
curl -X POST -d `cat file.xml` http://some.url |
This file contains hidden or 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
find . -name '*.ini' -type f -print0 | xargs -0 sed -i 's|oldstring|newstring|g' |
This file contains hidden or 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/bash | |
if [ "$1" == "" ]; then | |
echo Usage: $0 pngfile | |
exit 0; | |
fi | |
FILE=`basename $1 .png` | |
if [ ! -e $FILE.png ]; then |
This file contains hidden or 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
find . -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" " |
This file contains hidden or 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
PS1="\n\[\e[31;1m\]\u\[\e[31;1m\]\[\e[37;1m\]@\[\e[37;1m\]\[\e[36;1m\]\h\[\e[36;1m\] \[\e[34;1m\]\A \[\e[30;1m\]\[\e[37;1m\]\w \n\[\e[32;1m\]\$(/bin/ls -1 | /usr/bin/wc -l | /bin/sed 's: ::g') files, \$(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed 's/total //')b \[\e[37;1m\]$ \[\e[0m\]" |
This file contains hidden or 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
Import CSV: | |
$ mysqlimport --fields-optionally-enclosed-by='"' --fields-terminated-by="," --lines-terminated-by="\n" --user=root --password database_name output.csv | |
(load data local infile 'output.csv' into table mt fields terminated by ',' optionally enclosed by '"' ignore 1 lines;) | |
Export CSV: | |
Might need to set the file privilege first (GRANT FILE ON *.* TO 'root'@'%';) | |
$ chmod 777 -R /tmp/foo | |
mysqldump -uroot -p -t -T/tmp/foo database_name table_name --fields-optionally-enclosed-by='"' --fields-terminated-by="," --lines-terminated-by="\n" |
This file contains hidden or 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 | |
$path = "/path/to/images"; | |
$ritit = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::CHILD_FIRST); | |
$r = array(); | |
foreach ($ritit as $splFileInfo) | |
{ | |
$output = $error = array(); | |
if ($splFileInfo->getFilename() != '.' && $splFileInfo->getFilename() != '..') | |
{ |
NewerOlder