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
// iOS Media Queries | |
// Goal: capture styles for iPhone, iPhone 3G, iPhone 3GS, iPhone 4, iPhone 4S, iPad, and iPad 2 | |
// | |
// Author: Tony Schneider (@tonywok) | |
// Please tell me where I fail. :) | |
// iPhone v(4,4S) portrait | |
// test: black text (overwritten by v* portrait) with blue background | |
@media all and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait) { | |
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
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
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(){ | |
var isFirstVisit = false; | |
if ( document.referrer == '' ) { | |
isFirstVisit = true; | |
} else { | |
// If referrer is not the site itself | |
if ( ! ( document.referrer.match( window.location.host ) ) ) | |
isFirstVisit = true; | |
} | |
if ( isFirstVisit ) { |
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 /* | |
************************************************************************** | |
Plugin Name: Generate Thumbnails On The Fly | |
Description: When a thumbnail image is requested of a specific width/height (rather than by name), generate it if it doesn't exist. | |
Version: 1.0.0 | |
Author: Alex Mills (Viper007Bond) | |
Author URI: http://www.viper007bond.com/ |
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 custom_body_class($classes){ | |
global $wp_query; | |
if ( is_page() ) { | |
$post_obj = $wp_query->get_queried_object(); | |
array_push($classes, 'slug-'.$post_obj->post_name); | |
} | |
return $classes; |
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
# Set 644 permission on all PHP files recursively | |
find . -type f -name '*.php' -exec chmod 644 '{}' \+ |
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
# Count no of files in repo | |
svn info -R --xml file:///path/to/rep | grep kind=\"file\"|wc -l | |
# SVN command to give commit authors list and save it in author-transform.txt | |
svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors-transform.txt | |
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
<pre><?php | |
require 'wp-load.php'; | |
$postmeta_field_name = 'video_url'; // fill it | |
echo $query = "SELECT * FROM {$wpdb->postmeta} WHERE meta_key = '$postmeta_field_name';"; | |
$data = $wpdb->get_results( $query ); |
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 to remove wpautop filter for specific post IDs | |
*/ | |
add_action( 'init', 'do_ma_thang' ); | |
function do_ma_thang() { | |
global $wp_query; | |
$exclusion = array( 1, 5, 7 ); // add post IDs here |
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 | |
#Change your db username, password & database name | |
if [ -f ~/Desktop/db_schema.html ]; then | |
rm ~/Desktop/db_schema.html | |
fi | |
for i in `mysql -B -N -uroot -proot dbname -e 'show tables;'`; do | |
echo "<a href='#$i'>$i</a><br />" >> /tmp/$$.nav.html |