This file contains hidden or 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
update [table_name] set [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]'); |
This file contains hidden or 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
window.thirdParty = { | |
init: function() { | |
$('.share').before('<div class="share preview" onmouseover="thirdParty.load(this);"><img src="/static/images/share.png"></div>'); | |
}, | |
load: function(el) { | |
$(el).remove(); | |
thirdParty.plus1(); | |
thirdParty.twitter(); |
This file contains hidden or 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 | |
include_once './includes/bootstrap.inc'; | |
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); | |
drupal_flush_all_caches(); | |
?> |
This file contains hidden or 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
$.getJSON("http://urls.api.twitter.com/1/urls/count.json?url=%%URL%%&callback=?", function(data) { | |
if ((data.count != 0) && (data.count != undefined) && (data.count != null)) { | |
$("#twbutton").addClass('hascount'); | |
$("#twbutton").after('<a class="button count"><span>'+data.count+'</span></a>'); | |
} | |
}); | |
$.getJSON("https://graph.facebook.com/%%URL%%&callback=?", function(data) { | |
if ((data.shares != 0) && (data.shares != undefined) && (data.shares != null)) { | |
$("#fbbutton").addClass('hascount'); |
This file contains hidden or 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
$.getJSON("http://gdata.youtube.com/feeds/api/users/{{username}}/uploads?v=2&alt=jsonc&max-results=30", function (data) { | |
//profit?? | |
}); |
This file contains hidden or 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
update `wp_options` set `option_value` = replace(`option_value`,'website.dev','beta.example.com'); | |
update `wp_posts` set `guid` = replace(`guid`,'website.dev','beta.example.com'); | |
update `wp_posts` set `post_content` = replace(`post_content`,'website.dev','beta.example.com'); | |
update `wp_postmeta` set `meta_value` = replace(`meta_value`,'website.dev','beta.example.com'); | |
/* | |
Going from a development domain to a beta or production url - updating your wordpress database in a few queries. There may or may not be other tables/settings that should be update. I've found the above to work for me. |
This file contains hidden or 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
$('a[href$=".pdf"]').click(function(){ | |
ga('send', { | |
hitType: 'event', | |
eventCategory: 'Download', | |
eventAction: 'PDF', | |
eventLabel: this.href | |
}); | |
}); |
This file contains hidden or 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
cat ~/.ssh/id_rsa.pub | ssh USER@HOST "cat >> ~/.ssh/authorized_keys" |
This file contains hidden or 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
/* Responsinator Bookmarklet - simply show the viewport width to make it easy to see what media-query is being applied. | |
*/ | |
(function(){ | |
var el=document.createElement('div'); | |
el.style.position='fixed'; | |
el.style.height='50'; | |
el.style.width='300'; | |
el.style.margin='-25px -150px 0 0'; | |
el.id='unitseven-size'; | |
el.style.top='50%'; |
This file contains hidden or 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
/* | |
Latest Tweets Plugin | |
Markup required: | |
<div class="latestTweets" data-user="unitseven" data-count="3"></div> | |
*/ | |
(function( $ ) { | |
"use strict"; | |
function relative_time(time_value) { |
OlderNewer