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 | |
## Example: | |
## /bin/sh ~/htaccessdynamic.sh myhostname.dyndns-remote.com ~/infinatewp.mydomain.com/.htaccess | |
dynDomain="$1" | |
htaccessLoc="$2" | |
dynIP=$(/usr/bin/dig +short $dynDomain) | |
echo "dynip: $dynIP" |
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
//saw this on WpRecipes.com | |
function GravatarAsFavicon() { | |
//We need to establish the hashed value of your email address | |
$GetTheHash = md5(strtolower(trim('[email protected]'))); | |
echo 'http://www.gravatar.com/avatar/' . $GetTheHash . '?s=16'; | |
} | |
//in the header.php use this: |
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 add_video_wmode_transparent($html, $url, $attr) { | |
if (strpos($html, "<embed src=" ) !== false) { | |
$html = str_replace('</param><embed', '</param><param name="wmode" value="transparent"></param><embed wmode="transparent" ', $html); | |
return $html; | |
} else { | |
return $html; | |
} | |
} | |
add_filter('embed_oembed_html', 'add_video_wmode_transparent', 10, 3); |
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 | |
## Crontab Example: | |
## #*/3 * * * * /bin/sh ~/htaccessdynamic.sh whatevermydyndnsis.dyndns-remote.com ~/domainiwanttoprotect.com/.htaccess > /dev/null 2>&1 | |
dynDomain="$1" | |
htaccessLoc="$2" | |
dynIP=$(/usr/bin/dig +short $dynDomain) |
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
<script type="text/javascript"> | |
var now = new Date(), | |
day = now.getDay(), | |
hour = now.getHours(); | |
//Check if day is Mon | |
if(0 = day) { | |
//check between 11am and 11:30am | |
if(11 <= hours <= 00) { | |
if(hours !== 11 || now.getMinutes() <= 30) { |
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 $j = jQuery.noConflict(); | |
function changeYoutube() { | |
$j('iframe').each(function () { | |
var that = $j(this); | |
var href = that.attr('src'); | |
if (href.search('youtube.com') != -1) { | |
that.attr('src', href + '&autoplay=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
<?php | |
/* | |
* 공식 트위터 사이트에서는 트윗을 RT한 사람 목록을 볼 수가 있는데 | |
* 숫자가 조금만 많아도 줄여서 보여주기 때문에 모두 확인하기가 어렵다. | |
* | |
* 트위터 API를 써서 모두 확인하는 방법 | |
*/ | |
$tweet_id = '101450759463383041'; // 트위터 사이트에서 트윗한 시간을 누르면 확인 가능 |
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 | |
// Install this file in the infiniteWP folder, name it something | |
// obscure then have cron run ever 3 mins to update the db to the latest IP. | |
// Add the following to cron, this will update the ip address every 3 minutes. | |
// | |
// */3 * * * * /usr/local/bin/php /home/username/infinitewp/updateip.php | |
// What is your dyndns hostname? |
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
$("#form").keypress(function(e) { | |
if (e.which == 13) { | |
return false; | |
} | |
}); | |
//Source: http://www.catswhocode.com/blog/10-awesome-jquery-snippets |
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
//Need to clear all form data? Here’s a handy function to do it. | |
function clearForm(form) { | |
// iterate over all of the inputs for the form | |
// element that was passed in | |
$(':input', form).each(function() { | |
var type = this.type; | |
var tag = this.tagName.toLowerCase(); // normalize case | |
// it's ok to reset the value attr of text inputs, | |
// password inputs, and textareas |
OlderNewer