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
public function truncate($string, $length=100, $append="…") { | |
$string = trim($string); | |
if(strlen($string) > $length) { | |
$string = wordwrap($string, $length); | |
$string = explode("\n", $string, 2); | |
$string = $string[0] . $append; | |
} | |
return $string; |
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 -d memory_limit=-1 composer.phar install |
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
# As example I take pidgin container. | |
# Mount your x11: | |
docker run -d --device /dev/snd --name pidgin -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY thshaw/pidgin | |
# Store container id | |
export containerId=$(docker ps -l -q) | |
# Stop container | |
docker stop $containerId |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |