Skip to content

Instantly share code, notes, and snippets.

View mreidsma's full-sized avatar

Matthew Reidsma mreidsma

View GitHub Profile
@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/
@mreidsma
mreidsma / Readme.markdown
Created July 18, 2012 20:02
PHP script for Botriot to deploy code to server from git

Deploy code from git from your chatroom

This is a simple php script that can be used with the Botriot (http://botriot.com) service to deploy code hosted on Github. The script needs to live on the same server your live code will be on, but you can use it to deploy any project or site on a server.

Syntax

In your Campfire chatroom with your bot active, type:

!deploy directory/path OR botname directory/path

@mreidsma
mreidsma / ryerson.html
Created September 27, 2012 15:14
Ryerson Library sample of progressive enhancement of slideshow
<!DOCTYPE html>
<!--[if IE 6]>
<html id="ie6" class="lt-ie9 lt-ie8 lt-ie7 no-js" dir="ltr" lang="en-US">
<![endif]-->
<!--[if IE 7]>
<html id="ie7" class="lt-ie9 lt-ie8 no-js" dir="ltr" lang="en-US">
<![endif]-->
<!--[if IE 8]>
<html id="ie8" class="lt-ie9 no-js" dir="ltr" lang="en-US">
@mreidsma
mreidsma / LTC2013.markdown
Created October 6, 2012 02:46
Websites are for People (LTC2013 Talk Proposal)

Library websites are notoriously hard to use. Librarians and library staff spend much of their time training our patrons to use our online tools, instead of helping to develop deeper skills. While our tools are often complex, they seem to have been designed for the computers they run on rather than the people who use them. This issue has rightfully come to the forefront of the library world in recent years.

The usual debate is between making our tools so simple that anyone can use them, or training our patrons to use the complex tools. But there is middle ground here. We can make our tools easier without losing the power that much of their complexity brings. But we need to shift the burden of teaching how to use the tools from our staff to the tools themselves.

In this presentation, I'll talk about what we can learn from fields like evolutionary psychology and video game design that will help us build helpful and powerful websites that people can actually use.

@mreidsma
mreidsma / bukkitroulette.php
Created October 9, 2012 21:17
Bukk.it Roulette - pull a random image from Bukk.it with your Botriot Campfire bot.
<?php
$gotit = 0; // BOOLEAN for knowing that a command has been found
// Get the data from Bruce, our Campfire bot
$data = file_get_contents('php://input');
if($data == NULL) {
$command = "Weird.";
@mreidsma
mreidsma / summonMeL.js
Last active February 28, 2018 22:00
Add link to MeLCat (consortial book-sharing service) in Summon results for books and videos
$(".thumbnail").find("a").each(function(){
availabilityText = $(this).find('div.format').attr("class");
var availability = availabilityText.split(" ");
if((availability[2]== "format_book_lg") || (availability[2] == "format_video_recording_lg")) {
var searchTitle = $(this).closest(".document").find(".title").find("h3").text();
searchTitle = encodeURIComponent(searchTitle);
$(this).closest("table").find(".metadata").find(".Availability").append('<br /><p>Not available? <a href="http://elibrary.mel.org/search/a?searchtype=t&searcharg=' + searchTitle + '&SORT=D" target="_blank">Find this at another Michigan library</a></p>');
@mreidsma
mreidsma / gist:4596136
Created January 22, 2013 16:41
Automagically start playing a Rdio playlist and bring my text editor to the front in full screen mode
tell application "Rdio"
play source "p2128446"
end tell
activate application "Sublime Text 2"
delay 3
tell application "System Events"
set frontmost of process "Sublime Text 2" to true
tell process "Sublime Text 2"
keystroke "f" using {command down, control down, shift down}
@mreidsma
mreidsma / pause.applescript
Last active December 11, 2015 11:48
Script to tell Rdio desktop app to play and pause
tell application "Rdio"
pause
end tell
@mreidsma
mreidsma / Screenshots.markdown
Last active December 12, 2015 12:09
In SerialsSolutions Summon, make the title of the best bet the link and get rid of the weird "More" link.

Here's what the above script does:

Best Bets with descriptionBest bet with description (title is linked)
Best Bets with descriptionBest bet without description (title is linked)
@mreidsma
mreidsma / README.markdown
Last active August 20, 2018 12:26
Automator Workflow for Writing Environment

Automator Workflow for Writing Environment

The internet is a distracting place, and when you work there, it makes getting things done difficult. Especially things like writing a book (or two). So I made an automator script to help me out. Here's how it works:

  • It quits every application but iTunes, Writedown (my Markdown editor of choice), and Tictoc (my time tracking tool).
  • It shuts off Wifi so the Internet goes away.
  • It sets the computer's volume to an appropriate level.
  • It plays an iTunes playlist of ambientish music that is perfect background for writing.
  • It makes Writedown go full screen so I don't get distracted by other things.