Skip to content

Instantly share code, notes, and snippets.

View ianchan's full-sized avatar

Ian Chan ianchan

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.css" rel="stylesheet" type="text/css" />
<style id="jsbin-css">
body {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.css" rel="stylesheet" type="text/css" />
<style id="jsbin-css">
body {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.css" rel="stylesheet" type="text/css" />
<style id="jsbin-css">
body {
@ianchan
ianchan / scope-pop.js
Created September 5, 2019 00:59
Primo scope pop-down when user enters keywords
//This script courtesy of SJSU... thank you!
//use for homepage primo search
//searchboxID = input text box id
var csusmPrimoURL = "http://csusm-primo.hosted.exlibrisgroup.com/primo-explore";
function primoSearchBox(searchBoxID) {
clearSearch('#primoQueryTemp1');
@ianchan
ianchan / chart.html
Last active August 29, 2015 14:20 — forked from jweisman/chart.html
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1.1','packages':['corechart']}]}"></script>
<script>
google.setOnLoadCallback(drawChart);
function drawChart() {
xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET","https://api-na.hosted.exlibrisgroup.com/almaws/v1/analytics/reports?path=%2Fshared%2FAlma%2FFulfillment%2FReports%2FGeneral%20Circulation%20Statistics&apikey=[[APIKEY]]",false);
xmlhttp.send();
@ianchan
ianchan / gist:6a3b6236b139bf802971
Created January 16, 2015 21:26
Primo permalink example for API lookup
$("#table-list").append("<tr><td>"+resp.isbn+"</td><td>"+resp.author+"</td><td><a href='http://primo-pmtna01.hosted.exlibrisgroup.com/CALS_USM:"+resp.calsusm+"'>"+resp.title+"</a></td><td>"+resp.year+"</td></tr>");
@ianchan
ianchan / gist:1c2e04ccae32dec81303
Created January 16, 2015 18:59
Example of jQuery.Datatables
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.2/css/jquery.dataTables.css">
<script src="//cdn.datatables.net/1.10.2/js/jquery.dataTables.min.js"></script>
<script>
$(document).ready(function()
{
$("#coursesTable").dataTable({
"order": [[ 0, "asc" ]],
"lengthMenu": [[-1, 25, 50], ["All", 25, 50]]
});

Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.

TL;DR Demo

# Ensure system is in ship-shape.

aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev

@ianchan
ianchan / gist:dc8b5da4767ec5e8486d
Last active October 29, 2015 14:09
Alma API item lookup using barcode
<?php
header ("Content-Type:text/xml");
$ch = curl_init();
$url = 'https://api-na.hosted.exlibrisgroup.com/almaws/v1/items';
$queryParams = '?item_barcode=<substitute_barcode_here>&apikey=<your_api_key';
curl_setopt($ch, CURLOPT_URL, $url . $queryParams);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
/* Aska panel */
#block-block-6{
position: absolute;
padding: 2px;
width:160px;
border: 2px solid #ddd;
margin-left: 10%;
margin-top:20px;
}