Skip to content

Instantly share code, notes, and snippets.

View mreidsma's full-sized avatar

Matthew Reidsma mreidsma

View GitHub Profile
@mreidsma
mreidsma / randomize_confirm.js
Created March 21, 2012 20:11
Randomize the confirmation message displayed after form submission
// Have a span with the id of feedback-thanks in your document.
var ran1 = ["Thank you! Your feedback is important to us.","Thanks! Your feedback helps us find the best tools for you.","Thank you! Your feedback helps everyone doing research at GVSU."];
var randomNum = Math.ceil(Math.random()*3); /* Pick random number between 1 and 3 */
document.getElementById("feedback-thanks").innerHTML = ran1[randomNum];
@mreidsma
mreidsma / simpletooltip.js
Created March 26, 2012 17:47
A simple jQuery tooltip function that creates tooltips based on title attributes
// Tooltip
function tooltip(obj) {
// Check if tooltip is open already
var tipText = $(obj).attr("title");
if(tipText==undefined) { // No title
// Tooltip is open
@mreidsma
mreidsma / ArchiveandLogDone.scpt
Created April 17, 2012 03:38
Applescript to archive completed Taskpaper tasks to Google Calendar with ifttt.com
-- Archive completed Taskpaper tasks to Google Calendar with ifttt.com
-- First, set up the following recipe at ifttt.com to add completed tasks to your calendar:
-- http://ifttt.com/recipes/30256
--
-- Then use this Applescript to archive tasks. Mail.app needs to have the default account match your ifttt.com email
-- Let me know if you have any questions: [email protected] or @mreidsma
set archivedTasks to ""
@mreidsma
mreidsma / hidelibchat.html
Created April 26, 2012 21:26
Bookmarklet to hide #libchat Tweets (or any tweet containing certain text)
<a href="javascript:(function() {$('p.js-tweet-text:contains(\'libchat\')').parent().parent().parent().hide();})()">Hide #libchat</a>
@mreidsma
mreidsma / encoreChat.js
Created May 1, 2012 17:08
Replace meebo chat in III's Encore with Libraryh3lp chat
// Replace the meebo widget with a nice graphic or something.
var newContent = '<img src="http://placekitten.com/180/77" alt="Kitteh" />';
document.getElementById('meeboWidget').innerHTML = newContent;
// Now change the Launch link to open a new window with our libraryh3lp chat instead of meebo.
// Substitute the URL in the link below with yours (URL encoded)
// Enjoy.
@mreidsma
mreidsma / foursquare.php
Created May 1, 2012 17:24
Simple foursquare badge
<?php
// Show a small badge with your most recent foursquare login
// Pass your Foursquare history RSS feed to the script to show your latest login
// To get your feed, sign in & go to http://foursquare.com/feeds
// This will make your feed public to anyone who looks at the source of your site!
//
// We use this in Sharepoint inside a <gasp> iframe, like this:
//
// <iframe src="http://mywebsite.com/foursquare.php?feed=https://feeds.foursquare.com/history/sjahdasjdhajdasd.rss"></iframe>
@mreidsma
mreidsma / compose_gmail.js
Created May 30, 2012 14:09
Bookmarklet to send new gmail without opening up my inbox
javascript:(function(){window.open('https://mail.google.com/mail/?ui=2&view=cm&fs=1&tf=1&shva=1','Compose Gmail','status=no,directories=no,location=no,resizable=no,menubar=no,width=600,height=600,toolbar=no');})();
@mreidsma
mreidsma / EZdb.js
Created June 1, 2012 19:27
jQuery to make draggable links in our database admin page clickable.
// j is defined as jQuery noconflict mode on this page.
j("#other li").click(function() {
var selected = j(this).text();
selected = j.trim(selected);
var codeclass = j(this).attr("class");
var newlink = '<li class="' + codeclass + '">' + selected + '</li>';
j("#mpopular").append(newlink);
});
@mreidsma
mreidsma / EZdb_bookmarklet.js
Created June 1, 2012 19:48
Bookmarklet URL for db click hack
javascript:j('#other li').click(function(){var selected=j(this).text();selected=j.trim(selected);var codeclass=j(this).attr("class");var newlink='<li class="'+codeclass+'">'+selected+'</li>';j('#mpopular').append(newlink);});
@mreidsma
mreidsma / .htaccess
Created July 13, 2012 20:22
Simple click tracking script
// .htaccess
//
// Add this to the directory where your write.php will be stored
// This is an easy way to do an HTTP request to the script with the data
<IfModule mod_rewrite.c>
RewriteEngine On
# Change the following to the base directory of this file
RewriteBase /clickstats/