Skip to content

Instantly share code, notes, and snippets.

View conraddecker's full-sized avatar

Conrad Decker conraddecker

View GitHub Profile
@conraddecker
conraddecker / index.html
Created November 6, 2011 17:56
Google Calendar Events JS Pull
<h3>Upcoming US Holidays</h3>
<div id="agenda"></div>
<script>
function listEvents(root) {
var feed = root.feed;
var entries = feed.entry || [];
var html = ['<ul>'];
@conraddecker
conraddecker / gist:1358299
Created November 11, 2011 15:39
Pinterest JS Pin Pull
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script>
function test(data){
var entries = data.responseData.feed.entries;
console.log(entries);
$.each(entries, function(key, entry){
$("#pins").append(
$("<li>").append(entry.content)
(function(b,c,h,i,g,e,f,d){if(!b[h]||i>b[h].fn.jquery){f=c.documentElement.childNodes[0];d=c.createElement("script");d.type="text/javascript";d.src="https://ajax.googleapis.com/ajax/libs/jquery/"+i+"/jquery.min.js";f.appendChild(d);e=g;g=function($,L){$(d).remove();e($,L)}}(function a($){($=b[h])&&i<=$.fn.jquery?g(f?$.noConflict(1):$,!!f):setTimeout(a,50)})()})(window,document,"jQuery","1.4.4",function($,L){
$("div.Project a:contains('Order #')").each(function(){
url = "https://myaccounturl.basecamphq.com"+$(this).attr("href")+"/project/delete_project"
$.post(url);
});
});
@conraddecker
conraddecker / gist:1398806
Created November 28, 2011 02:12
Basic Basecamp Bulk Project Delete (Brief: http://cdv.tc/sR12JA)
(function(b,c,h,i,g,e,f,d){if(!b[h]||i>b[h].fn.jquery){f=c.documentElement.childNodes[0];d=c.createElement("script");d.type="text/javascript";d.src="https://ajax.googleapis.com/ajax/libs/jquery/"+i+"/jquery.min.js";f.appendChild(d);e=g;g=function($,L){$(d).remove();e($,L)}}(function a($){($=b[h])&&i<=$.fn.jquery?g(f?$.noConflict(1):$,!!f):setTimeout(a,50)})()})(window,document,"jQuery","1.4.4",function($,L){
$("div.Project").each(function(){
url = "https://youraccounturl.basecamphq.com"+$(this).attr("href")+"/project/delete_project"
$.post(url);
});
});
<!-- This conditional handles photo galleries in the nav; They will default to showing the first gallery, as each gallery is desired to have it's own page -->
{elseif $node.object.class_identifier|eq('photo_gallery_page')}
{def $gallery = $node.children.0}
<a href={$gallery.url_alias|ezurl}{section show=$accesskey} accesskey="{$accesskey}"{/section}{section show=$class} class="{$class}"{/section}{if eq(true,$gallery.data_map.omniture_id.has_content)} name="omni_{$gallery.data_map.omniture_id.content}_{$omniture_part
{else}
@conraddecker
conraddecker / gist:1603341
Created January 12, 2012 21:44
Basics for a bookmarklet
javascript: (function () {
_bookmarklet = document.createElement('script');
_bookmarklet.id = 'bookmarklet';
if (document.getElementById(_bookmarklet.id)) {
bookmarkletobject.init();
} else {
_bookmarklet.type = 'text/javascript';
_bookmarklet.src = 'http://assets.domain.com/jsfile.js?x=' + (Math.random());
document.getElementsByTagName('head')[0].appendChild(_bookmarklet);
}
<ul>
<li class="youtube">
<a href="http://www.youtube.com/user/myqrad" target="_blank">Youtube</a>
</li>
<li class="facebook">
<a href="http://www.facebook.com/myQRad" target="_blank">Facebook</a>
</li>
<li class="linkedin">
<a href="http://www.linkedin.com/groups/myQRad-4321328?trk=myg_ugrp_ovr" target="_blank">LinkedIn</a>
</li>
<ul>
<li>
<a href="http://www.myqrad.com/about-us">About Us</a>
</li>
<li>
<a href="http://www.myqrad.com/contact-us">Contact Us</a>
</li>
<li>
<a href="http://www.myqrad.com/support">Support</a>
</li>
<h3>Need Help?</h3>
<p>Sometimes it’s a bit hard to know what to do with your QRad. See some examples of how others have used our service to help drive business.</p>
<p> <a href="#">Open Gallery</a> </p>
<ul>
<li>
<a href="/">Home</a>
</li>
<li>
<a href="#">About</a>
</li>
<li>
<a href="#">Contact</a>
</li>