Skip to content

Instantly share code, notes, and snippets.

View jasontucker's full-sized avatar

Jason Tucker jasontucker

View GitHub Profile
### Keybase proof
I hereby claim:
* I am jasontucker on github.
* I am jasontucker (https://keybase.io/jasontucker) on keybase.
* I have a public key whose fingerprint is E490 ED04 7059 1072 BF11 968C 9A18 783E 8A9B 8F1F
To claim this, I am signing this object:
@jasontucker
jasontucker / gist:d0c0b5b958235a5affc4
Created February 8, 2015 18:09
New.LiveStream.com Viewercount
xidel --user-agent "fogent" "http://new.livestream.com/EvFreeFullerton/events/2393629" -q --extract '//strong[@class="js-viewer_count_number"]'
@jasontucker
jasontucker / redownload.sh
Created September 5, 2015 03:15
WordPress - Redownload all installed and active plugins
active=$(wp plugin list --status=active --format=csv --fields=name)
for plugin in $active; do
(
if [ ! $plugin = 'name' ]; then
wp plugin install $plugin --force
fi
)
done
@jasontucker
jasontucker / gist:3757446
Created September 20, 2012 18:09
How to use your Gravatar as a favicon
//saw this on WpRecipes.com
function GravatarAsFavicon() {
//We need to establish the hashed value of your email address
$GetTheHash = md5(strtolower(trim('you@yourdomain.com')));
echo 'http://www.gravatar.com/avatar/' . $GetTheHash . '?s=16';
}
//in the header.php use this:
@jasontucker
jasontucker / gist:3780458
Created September 25, 2012 07:30
filter oembed for wmode transparent youtube video
<?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);
@jasontucker
jasontucker / gist:3856670
Created October 9, 2012 04:47
WPwatercooler at 11 to 11:30am autoplay
<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) {
@jasontucker
jasontucker / gist:3856679
Created October 9, 2012 04:50
Modify iFrame code to autoplay on Mondays, later I'll narrow it down to 11:00 11:30am
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');
@jasontucker
jasontucker / output.txt
Created October 16, 2012 20:42 — forked from mckabi/get_full_RTers.php
Get all of RTers by tweet
<?php
/*
* 공식 트위터 사이트에서는 트윗을 RT한 사람 목록을 볼 수가 있는데
* 숫자가 조금만 많아도 줄여서 보여주기 때문에 모두 확인하기가 어렵다.
*
* 트위터 API를 써서 모두 확인하는 방법
*/
$tweet_id = '101450759463383041'; // 트위터 사이트에서 트윗한 시간을 누르면 확인 가능
@jasontucker
jasontucker / updateip.php
Created October 26, 2012 19:32
Update single ip address from dyndns into the allowed IP address of InfiniteWP
<?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?
@jasontucker
jasontucker / gist:3981492
Created October 30, 2012 16:52
Disable “enter” key in your forms
$("#form").keypress(function(e) {
if (e.which == 13) {
return false;
}
});
//Source: http://www.catswhocode.com/blog/10-awesome-jquery-snippets