Skip to content

Instantly share code, notes, and snippets.

View megantaylor's full-sized avatar

Megan Taylor megantaylor

View GitHub Profile
@megantaylor
megantaylor / equalcolumnheight.html
Created April 16, 2013 17:40
Equal Column Height with CSS Table Technique
<style>
.main, .sidebar {
float: none;
padding: 20px;
vertical-align: top;
}
.container {
display: table;
}
.main {
@megantaylor
megantaylor / custom-field-query.php
Created November 14, 2012 15:46
WordPress query for custom field
<?php echo get_post_meta($post->ID, 'pubname', true); ?>
<?php if ( $pubname ) : ?>
<div id="pub"><?php echo $pubname; ?></div>
<?php else : ?>
<?php endif; ?>
@megantaylor
megantaylor / random-posts.php
Created November 14, 2012 15:44
WordPress Random Posts Query
<?php
/*
Plugin Name: Random Posts Query
Description: Imparts random display functionality to posts generated via
query_posts in older versions of WordPress (especially great for version 2.3)
Author URI: http://wordpress.org/support/topic/70359?replies=3#post-444323
*/
// usage: include "random=true" as a parameter in your query_posts loop
@megantaylor
megantaylor / FBTab.html
Created November 14, 2012 15:42
Code for Facebook tab
<div id="fb-root"></div>
<Script>
FB.init({appId:'200416043320418', xfbml:true});
fb.canvas.setautoresize();
</Script>
<script>
window.fbAsyncInit = function() {
@megantaylor
megantaylor / Twitter Sharer
Created November 7, 2012 15:48
Twitter share code with customized text, via, hashtag
<a href="https://twitter.com/share?url=url to share&amp;via=username&amp;text=This%20will%20show%20up&amp;hashtags=hashtag it up" class="twitter-share-button">Tweet This</a>
@megantaylor
megantaylor / Facebook Sharer
Created November 7, 2012 15:47
Facebook sharer code with customized description, image and title
<a title="Share this article/post/whatever on Facebook" onclick="return !window.open(this.href, 'Facebook', 'width=640,height=300')" href="http://www.facebook.com/sharer.php?s=100&p[url]=url to share&p[images][0]=the image you want to share&p[title]=the title you want to share&p[summary]=the description/summary you want to share">Share on Facebook</a>
@megantaylor
megantaylor / UdacityST101.txt
Created September 13, 2012 13:59
Udacity ST101
Optional code for Udacity ST101
6. Programming Charts
6.3 Plot Height
#Plot a histogram of Height using the histplot function
from plotting import *
Height=[65.78, 71.52, 69.4, 68.22, 67.79, 68.7, 69.8, 70.01, 67.9, 66.78,
@megantaylor
megantaylor / tweetcounter.php
Created August 1, 2012 15:14
Count Tweets to Blog Post
/* Script to count number of tweets since yesterday and trigger an email reminding user to write a blog post if the user has tweeted more than X times. */
<?php
$yesterday = strtotime("-1 day", strtotime("now"));
$searchdate = date("Y-m-d", $yesterday);
$hashtag = 'from:username since:'.$searchdate;
$total = 0;
function getTweets($hashtag, $page) {
global $total, $hashtag;
$url = 'http://search.twitter.com/search.json?q='.urlencode($hashtag).'&';
@megantaylor
megantaylor / EmailTemplateBlue
Created April 24, 2012 18:03
email template
<html>
<body style="background-color:#807F83;" bgcolor="#807F83">
<div style="background-color:#ffffff; width:640px; margin:0px auto;" align="center" bgcolor="#ffffff">
<table border="0" cellspace="0" cellpadding="0" width="600" bgcolor="#ffffff" style="border-collapse:collapse; background-color:#ffffff;" align="center">
<tr>
<td colspan="2">
[[?x42x::x[[S4]]x:: :: ]]
<p style="font-size: 12px; color: #333333; font-family: 'Trebuchet MS';">Is this email not displaying correctly? <a class="blue" style="color: #54b948;" href="http://[[S29:DOMAIN]]/site/MessageViewer" target="_blank">View it in your browser</a>.</p>
</td>
</tr>
@megantaylor
megantaylor / twitter_example.html
Created September 30, 2011 19:13 — forked from kjam/twitter_example.html
Twitter Search
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$.getJSON('http://search.twitter.com/search.json?q=earthquake&callback=?', function(data) {
var data = data.results;
var html = "<ul>";
for(var i=0; i<data.length; i++) {
html += "<li><a href='http://twitter.com/" + data[i].from_user + "'>@" + data[i].from_user + "</a>: " + data[i].text + "</li>";