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
function new_subcategory_hierarchy() { | |
$category = get_queried_object(); | |
$parent_id = $category->category_parent; | |
$templates = array(); | |
if ( $parent_id == 0 ) { | |
// Use default values from get_category_template() | |
$templates[] = "category-{$category->slug}.php"; |
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
chown -R www-data:www-data * # Let apache be owner | |
find . -type d -exec chmod 755 {} \; # Change directory permissions rwxr-xr-x | |
find . -type f -exec chmod 644 {} \; # Change file permissions rw-r--r-- |
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
find . -type f -exec file --mime {} \; | grep "charset=utf-16" |
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
for i in `find . -name *.mp4`; do echo $i; j=`echo $i | sed -e 's/.mp4/.jpg/'`; echo $j; ffmpeg -y -i $i -f mjpeg -vframes 1 -ss 3 $j; done |
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
.sidemenu { | |
overflow: hidden; | |
position: fixed; | |
top: 0; | |
left: 0; | |
width: 100%; | |
} |
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
$ curl -s -w "%{time_total}\n" -o /dev/null http://www.google.com/ | |
0.095 | |
$ for i in {1..3};do curl -s -w "%{time_total}\n" -o /dev/null http://www.google.com/; done | |
1.079 | |
0.124 | |
0.106 | |
$ curl -w "@curl-format" -o /dev/null -s http://www.google.com/ | |
time_namelookup: 0.416 | |
time_connect: 0.435 | |
time_appconnect: 0.000 |
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
// implicit cast | |
+true; // 1 | |
+false; // 0 | |
// bit shift by zero | |
true >>> 0; // 1, right zerofill | |
false >>> 0; // 0 | |
true << 0; // 1, left | |
false << 0; // 0 | |
// double bitwise NOT | |
~~true; // 1 |
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
osx$ boot2docker up | |
osx$ boot2docker ssh | |
docker@boot2docker$ sudo echo "nameserver 8.8.8.8" > /etc/resolv.conf | |
docker@boot2docker$ sudo /etc/init.d/docker restart |
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/bash | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) |
OlderNewer