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 | |
# By Ashfame | |
while true | |
do | |
# keep checking for idle dropbox status | |
STATUS=`dropbox status` | |
if [ $STATUS = 'Idle' ]; then | |
notify-send "System Shutdown" "System will power off now" |
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 |
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 | |
/** | |
* SugarCRM RESTS API Call examples | |
* | |
* REST API Wrapper - https://github.com/asakusuma/SugarCRM-REST-API-Wrapper-Class | |
*/ | |
?> | |
<!doctype html> | |
<head> | |
<meta charset="utf-8"> |
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
<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
# 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
(function($){ | |
// Regular jQuery code inside | |
$(document).ready(function(){ | |
}); | |
})(jQuery); |
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 | |
/** | |
* Define type of server | |
* | |
* Depending on the type other stuff can be configured | |
* Note: Define them all, don't skip one if other is already defined | |
*/ | |
define( 'DB_CREDENTIALS_PATH', dirname( ABSPATH ) ); // cache it for multiple use |
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 | |
/** | |
* WordPress config file to use one directory above WordPress root, when awesome version of wp-config.php is in use. | |
* | |
* Awesome wp-config.php file - https://gist.github.com/1923821 | |
*/ | |
/* WordPress Local Environment DB credentials */ |
OlderNewer