Skip to content

Instantly share code, notes, and snippets.

@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 / 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
<?php
//configs
$email_to ='me@myemail-address.com'; //put your email address here
$email_subject_prefix ='MySite.com contact form: '; //put the email sibject line prefix here
$email_from ='server@yourserver.com'; //put the email address that this form will be sent from
$email_from_nice ='Server'; //put in the 'nice' name for the email sender
//If the form is submitted
if(isset($_POST['submit'])) {
<?php
//configs
$email_to ='me@myemail-address.com'; //put your email address here
$email_subject_prefix ='MySite.com contact form: '; //put the email sibject line prefix here
$email_from ='server@yourserver.com'; //put the email address that this form will be sent from
$email_from_nice ='Server'; //put in the 'nice' name for the email sender
//If the form is submitted
if(isset($_POST['submit'])) {
<?php
//configs
$email_to ='me@myemail-address.com'; //put your email address here
$email_subject_prefix ='MySite.com contact form: '; //put the email sibject line prefix here
$email_from ='server@yourserver.com'; //put the email address that this form will be sent from
$email_from_nice ='Server'; //put in the 'nice' name for the email sender
//If the form is submitted
if(isset($_POST['submit'])) {
@justinkelly
justinkelly / gist:480987
Created July 19, 2010 03:43
Pinboard.in & Delicious to RSS script
<?php
/** Config section - start **/
$bookmark_user = "--your-username-";
$bookmark_pass = "--your-password";
$bookmark_service = "pinboard.in"; // pinboard.in or delicious.com/del.icio.us
/** Config section - end **/
<VirtualHost *:80>
# Admin email, Server Name (domain name) and any aliases
ServerAdmin webmaster@domain1.com
ServerName redmine.yourdomain.com
DocumentRoot /usr/share/redmine/public
# Custom log file locations
LogLevel warn
<Directory />
Options FollowSymLinks
AllowOverride All
Options -Indexes
</Directory>
Alias /code /var/bzr/repo/
WSGIScriptAliasMatch ^/code/.*/\.bzr/smart$ /var/bzr/repo/bzr_serve.wsgi
@justinkelly
justinkelly / javascript_mobile_OS_detector.js
Created October 12, 2010 03:09
Javascript mobile OS detector
/*
* Simple javascript mobile OS / iphone/ android detector
*
* License: GPLv3+
* Author: justin.kelly.org.au
*
*/
$(document).ready(function() {
var deviceIphone = "iphone";
@justinkelly
justinkelly / trac.wsgi
Created October 22, 2010 00:14
trac wsgi file for parent dir
# for more info refer: http://blog.justin.kelly.org.au/tracwsgi-for-tracenvparentdir
# based on the trac.wsgi used for the trac + bzr hosting service http://bzr.bz
import sys
sys.stdout = sys.stderr
import os
os.environ['TRAC_ENV_PARENT_DIR'] = '/var/www/trac'
os.environ['PYTHON_EGG_CACHE'] = ' /usr/share/pyshared'