Skip to content

Instantly share code, notes, and snippets.

View AndyCouch's full-sized avatar

Andy Couch AndyCouch

View GitHub Profile
@AndyCouch
AndyCouch / auto_link.php
Created May 18, 2017 16:27
PHP Auto-link Function
@AndyCouch
AndyCouch / external-links.js
Created May 18, 2017 17:25
DOM Scripting External Links
@AndyCouch
AndyCouch / pagination.php
Created May 18, 2017 20:13
Pagination with PHP
<?php
// sample MySQL database connection and query to get a dataset
$dbConnection = mysql_connect("localhost", "usename", "password");
mysql_select_db("foo", $dbConnection);
$dbQuery = "SELECT t.table_id, t.data FROM table AS t ORDER BY t.table_id ASC";
// set how many items to show per page
$limit = 50;
// count the total number of items that the query returns
@AndyCouch
AndyCouch / outlook-notification.scpt
Created May 18, 2017 20:27
AppleScript for Outlook 2011 and OS X Notification Center Integration
-- Get a list of all "current messages" in Outlook.
tell application "Microsoft Outlook"
set currentMessages to the current messages
end tell
-- Loop through the messages.
repeat with eachMessage in currentMessages
tell application "Microsoft Outlook"
-- Only notify about unread messages.
if is read of eachMessage is false then
@AndyCouch
AndyCouch / underline-links.scss
Last active December 10, 2017 16:04
Cross-browser underline with breaks for descenders.