Skip to content

Instantly share code, notes, and snippets.

View ianchan's full-sized avatar

Ian Chan ianchan

View GitHub Profile
@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();

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 / computer-drupal.php
Created August 9, 2012 19:02 — forked from griggsk/computer-drupal.php
Computer Availability Map UI for Drupal
<?php
drupal_add_css("sites/all/themes/osulibraries/comp_map.css");
drupal_add_js('setTimeout("window.location.reload()",300000);', 'inline');
db_set_active('comp_map');
$total_pc_results = db_query("SELECT * FROM compstatus WHERE computer_type='PC'");
$avail_pc_results = db_query("SELECT * FROM compstatus WHERE status='0' AND computer_type='PC'");
$pcs = mysql_num_rows($avail_pc_results) . '/' . mysql_num_rows($total_pc_results);
@ianchan
ianchan / computers.php
Created August 9, 2012 19:02 — forked from griggsk/computers.php
Computer Availability Map UI
<?php
#add your database username and password
$user="username";
$password="password";
$database="computer_availability";
#connect to the database
$DB = mysql_connect('mysqlcluster.adm.yourmysqlserver.edu', $user, $password);
@mysql_select_db($database) or die("Unable to select database");
@ianchan
ianchan / computers.php
Created August 9, 2012 19:01 — forked from griggsk/computers.php
Computer Availability Map UI
<?php
#add your database username and password
$user="username";
$password="password";
$database="computer_availability";
#connect to the database
$DB = mysql_connect('mysqlcluster.adm.yourmysqlserver.edu', $user, $password);
@mysql_select_db($database) or die("Unable to select database");
@ianchan
ianchan / statuschange.php
Created August 9, 2012 17:12 — forked from griggsk/statuschange.php
Computer Availability status change script
#add your database username and password
$user="username";
$password="password";
$database="computer_availability";
#unless the computers name was empty
if($_POST['workstation'] != ""){
$workstation = strtoupper($_POST['workstation']);
}
else{ #build the computer's name from the host