Skip to content

Instantly share code, notes, and snippets.

@justinkelly
justinkelly / equella.sql
Created March 10, 2017 01:54
Equella date format log
select extract( day from diff ) days,
extract( hour from diff ) hours,
extract( minute from diff ) minutes,
extract( second from diff ) seconds,
(select Max("timestamp") - Min("timestamp")) diff
from equella.audit_log_entry;
@justinkelly
justinkelly / custom.js
Last active March 12, 2017 04:59
Primo - New UI - responsive logo
(function () {
"use strict";
'use strict';
var app = angular.module('viewCustom', ['angularLoad']);
/****************************************************************************************************/
/*In case of CENTRAL_PACKAGE - comment out the below line to replace the other module definition*/
/*var app = angular.module('centralCustom', ['angularLoad']);*/
/****************************************************************************************************/

Keybase proof

I hereby claim:

  • I am justinkelly on github.
  • I am justinkelly (https://keybase.io/justinkelly) on keybase.
  • I have a public key whose fingerprint is CDB0 8D2E 14E3 3A9F E14E E183 C07D 8218 0A00 6212

To claim this, I am signing this object:

To: [email protected]
From: [email protected]
Subject: test message
Test message for ssmtp.
@justinkelly
justinkelly / ssmtp.conf
Last active April 20, 2016 02:44
ssmtp.conf settings
#/bin/sh
echo "mailhub=${SMTP_HOST}:${SMTP_PORT}" > /etc/ssmtp/ssmtp.conf
echo "AuthUser=${SMTP_USER}" >> /etc/ssmtp/ssmtp.conf
echo "AuthPass=${SMTP_PASS}" >> /etc/ssmtp/ssmtp.conf
echo "UseSTARTTLS=YES" >> /etc/ssmtp/ssmtp.conf
@justinkelly
justinkelly / after_footer.html
Created October 19, 2015 03:04
Google Plus for Octopress - footer
@justinkelly
justinkelly / gist:a392483775679377f869
Last active August 29, 2015 14:20
Atom.io text replace for ReseachBank
Date.prototype.yyyymmdd = function() {
var yyyy = this.getFullYear().toString();
var mm = (this.getMonth()+1).toString(); // getMonth() is zero-based
var dd = this.getDate().toString();
return yyyy + (mm[1]?mm:"0"+mm[0]) + (dd[1]?dd:"0"+dd[0]); // padding
};
d = new Date();
$date = d.yyyymmdd();
editor = atom.workspace.activePaneItem
@justinkelly
justinkelly / Alma_highlight_call_number.js
Last active August 29, 2015 14:08
Additional javascript for Alma to highlight the call number
//trim left and right white space
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, "");
};
//get call number
var CALL = document.getElementById("holdingKey").value;
var CALL_LIST = CALL.split(',');
var NUMB = CALL_LIST.slice(-1)[0];
var CALL_NUMBER = NUMB.split('=').slice(-1)[0];
@justinkelly
justinkelly / pdf_merge.php
Created August 19, 2013 05:54
merge pdfs with php
<?php
$path ="lib/";
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
require_once 'lib/Zend/Pdf.php';
// LOAD PDF DOCUMENTS
$pdf1 = Zend_Pdf::load('first.pdf');
$pdf2 = Zend_Pdf::load('second.pdf');
// WE WILL MERGE OUR TWO PDF FILES INTO A NEW ZEND_PDF OBJECT
$pdfMerged = new Zend_Pdf();
<?php
$user = $_SERVER['PHP_AUTH_USER'];
$date = date("Y-m-d H:i:s");
$myFile = "download_log.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$stringData = "Date , ". $date ." , User , ". $user ."\n";
fwrite($fh, $stringData);
fclose($fh);