Skip to content

Instantly share code, notes, and snippets.

@justinkelly
justinkelly / json_extract_c.sql
Last active February 4, 2018 12:27
json_extract_c for mysql 5.5
DELIMITER $$
DROP FUNCTION IF EXISTS `json_extract_c`$$
CREATE FUNCTION `json_extract_c`(
details TEXT,
required_field VARCHAR (255)
) RETURNS TEXT CHARSET latin1
READS SQL DATA
@justinkelly
justinkelly / .tmux.conf
Last active July 30, 2017 05:17
Tmux Conf
# Set prefix key to Ctrl-a
unbind-key C-b
set-option -g prefix C-a
# Highlight active window
set-window-option -g window-status-current-bg red
set -g default-terminal "screen-256color"
@justinkelly
justinkelly / markdown-editor.html.erb
Last active March 14, 2017 23:49
Markdown editor for StandardNotes
<!DOCTYPE html>
<html>
<head>
<%= stylesheet_link_tag 'codemirror' %>
<%= javascript_include_tag 'codemirror' %>
<%= javascript_include_tag 'loadmode' %>
<%= javascript_include_tag 'cm-meta' %>
<style>
body, html {
@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']);*/
/****************************************************************************************************/
@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 / 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;

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:

@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
To: youremail@gmail.com
From: you@comcast.net
Subject: test message
Test message for ssmtp.
@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();