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
svn status | grep "^\?" | awk '{print $2}' | xargs svn add |
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 . -name ".svn" -exec rm -Rf ./{} \; |
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 axcoto_get_lastest_comments() { | |
global $wpdb; | |
$sql = " | |
SELECT c.comment_ID, c.comment_author, c.user_id, c.comment_content, | |
p.post_title, p.ID | |
FROM $wpdb->comments as c | |
LEFT JOIN $wpdb->posts as p ON p.ID=c.comment_post_ID | |
WHERE c.comment_approved=1 | |
ORDER BY c.comment_date DESC | |
LIMIT 5 |
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 userAdd($username, $password, $email) { | |
if (get_user_by_email($email)) { | |
return array('error' => 1, 'msg' => '<span>This email has already taken</span>'); | |
} | |
if (get_user_by('login', $username) || get_user_by('slug', $username)) { | |
return array('error' => 2, 'msg' => '<span>This username has already taken</span>'); | |
} | |
if (wp_create_user($username, $password, $email)) { | |
return array('error' => 0); | |
}; |
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
//RAW SQL | |
SELECT u.ID, u.user_nicename | |
FROM wp_users AS u | |
LEFT JOIN wp_usermeta AS m ON m.user_id=u.ID AND m.meta_key='wp_capabilities' | |
WHERE m.meta_value LIKE '%contributor%' | |
//PHP | |
$sql = " | |
SELECT u.ID, u.user_nicename | |
FROM $wpdb->users AS u |
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 | |
$textImages[$index] = imagecreatetruecolor($textBox['width'], $textBox['height']); | |
imagealphablending($textImages[$index], true); | |
imagesavealpha($textImages[$index], true); | |
$overlayColor = imagecolorallocatealpha($textImages[$index], 0, 0, 0, 127); | |
imagefill($textImages[$index], 0 , 0, $overlayColor); | |
?> |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js" type="text/javascript"></script> | |
<script> | |
$j1 = jQuery.noConflict(); | |
(function ($) { |
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
SELECT COUNT(*) | |
FROM rico_bb_topics | |
WHERE TO_DAYS(topic_start_time)=TO_DAYS(CURDATE()); |
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
var l = $('<link>') | |
.appendTo('head') | |
.attr({ | |
rel: "stylesheet", | |
type: "text/css", | |
href: theme | |
}); |
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 | |
//EST is 3 hours foward of LA time | |
date_default_timezone_set('America/Los_Angeles'); | |
$date = date("Y-m-d", time() + 3600 * 3); | |
OlderNewer