Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Currie andrewjcurrie

View GitHub Profile
View datatrac-home.js
var product_classes = ['checking'];
var market_ids = [16970];
var market_names = {};
var default_mkt_id = 16970;
var api_key = "d5c57ba3-1831-4533-9f01-ab671bac2579";
var fileUrl = "https://api.datatrac.net/api/Thresholds.json?MarketID=" + market_ids.toString() + "&ProductClass=" + product_classes.toString() + "&ApiKey=" + api_key;
$(window).load(function(){
"use strict";
View datatrac.js
var product_classes = ['auto','mortgage','home+equity','credit+card','boat','rv','money+market','savings','checking','cd','ira'];
var market_ids = ['16970'];
var market_names = ['Saint Louis Metro'];
var default_mkt_id = 16970;
var api_key = "d5c57ba3-1831-4533-9f01-ab671bac2579";
var fileUrl = "https://api.datatrac.net/api/Thresholds.json?MarketID=" + market_ids.toString() + "&ProductClass=" + product_classes.toString() + "&ApiKey=" + api_key;
/* ------- smooth scrolling ----- */
$(function() {
"use strict";
View launch_sublime_from_terminal.markdown

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@andrewjcurrie
andrewjcurrie / website.backup.sh
Last active Apr 13, 2021
Website Backup Shell Script
View website.backup.sh
#!/bin/bash
#
# Website Backup Shell Script
# by Andrew Currie (andrew@digitalpci.com)
#
# Performs a full backup of the specified database and document root.
# Be sure to edit the configuration options at the beginning of the file to match your environment prior to executing.
# The end result will be one TAR archive with the name 'website-backup-(current-datestamp)'.
# The backup includes the entire document root directory and also a 'database.sql' file containing a MySQL dump of the database.
#
@andrewjcurrie
andrewjcurrie / total.hours.js
Last active Aug 29, 2015
Total Hours from 2 EE Time Select Fields
View total.hours.js
<script type="text/javascript">
$(function() {
$('#arrival_hour, #arrival_minutes, #arrival_noon, #departure_hour, #departure_minutes, #departure_noon').on('change', function(event) {
var arrival_hour = $('#arrival_hour').val();
var arrival_minute = $('#arrival_minutes').val();
var departure_hour = $('#departure_hour').val();
var departure_minute = $('#departure_minutes').val();
if (arrival_hour && arrival_minute && departure_hour && departure_minute) {
@andrewjcurrie
andrewjcurrie / pi.multiply.php
Last active Aug 29, 2015
Multiplication Plugin for ExpressionEngine 2
View pi.multiply.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$plugin_info = array(
'pi_name' => 'Multiplication',
'pi_version' => '1.0',
'pi_author' => 'Andrew Currie',
'pi_author_url' => 'https://www.digitalpci.com',
'pi_description' => 'Multiply numbers delimited by |',
'pi_usage' => Multiply::usage()
);