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
# Show all files | |
defaults write com.apple.finder AppleShowAllFiles YES | |
# Don't show hidden files | |
defaults write com.apple.finder AppleShowAllFiles NO |
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 windowHistorySupported() { | |
// If pushState is supported, return true, else return false. | |
return !!(window.history && window.history.pushState); | |
} |
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
osascript -e "set Volume 3.5" | |
afplay ~/Dropbox/Sounds/itssofluffy.mp3 | |
osascript -e "set Volume 1.25" |
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
'menu_icon' => plugins_url('images/custom-post-type-icon.png', __FILE__) |
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
$query = new WP_Query( array( | |
'post_type' => 'event_type', | |
'post_status' => 'publish', | |
'nopaging' => true | |
) ); | |
while ( $query->have_posts() ) : $query->the_post(); | |
// Do something with the post here... | |
endwhile; | |
wp_reset_postdata(); |
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
This resets the array's internal pointer to the first element: | |
reset( $array ); | |
This does not modify the original array, but does make a copy of it, only use it for small arrays: | |
array_shift(array_values($array)); |
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
# Tailored for default debian host on Google Cloud Compute, | |
# but should work for most Ubuntu/Debian systems. | |
# Be sure to replace 'example.com' with your URL. | |
# install zip, vim and wget | |
sudo apt-get update | |
sudo apt-get upgrade -y | |
sudo apt-get install -y zip vim wget | |
# install nodejs 0.10.xx |
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
if _, err := os.Stat("/path/to/file/or/dir"); os.IsNotExist(err) { | |
// /path/to/file/or/dir does not exist | |
} | |
if _, err := os.Stat("/path/to/file/or/dir"); err == nil { | |
// /path/to/file/or/dir exists | |
} |
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
sudo lsof -i | |
sudo netstat -lptu | |
sudo netstat -tulpn |