Skip to content

Instantly share code, notes, and snippets.

View ModalRouter.jsx
import React from 'react';
import {Switch, Link, Route, HashRouter} from 'react-router-dom';
import {Modal, Button} from 'react-bootstrap';
const UserModal = () => {
return (
jcartledge /
Last active Dec 31, 2017
Set up wifi and install shairport-sync on C.H.I.P (or similar debian/raspbian etc environment).
# start over serial connection
sudo nmcli dev wifi con "<SSID>" password "<PASSWORD>"
sudo apt-get update
sudo apt-get install shairport-sync
sudo vi /etc/default/avahi-daemon # set AVAHI_DAEMON_DETECT_LOCAL=0
View gist:d6ab89e797f69f27ffe1

Automatically selecting a facet the user didn't click is not really possible in the current technical design, but more importantly has UX/IxD implications we need to work out - e.g.

  • When the user selects a facet the page URL updates so you can link to a filtered list - how does this affect that? Do they get the URL with or without the automatically selected option?
  • What happens if the user follows a link to the page that's filtered by ATAR range? Do we redirect to one that's filtered by atar and no atar or respect the original url?
  • What if the user a) selects a range (+ the auto item they did not select), deselects the auto item, deselects the range, then selects the range again? Does this only happen the first time, or all subsequent times?
  • What if in the above scenario the user selects a different range at the last step? Do we add the auto item then or only the first time?
  • What if the user selects multiple ATAR ranges? Does the automatically selected item stay selected until they deselect i

Some notes about ruby syntax

Optional parens

When calling a function or method, parens are optional, so:

puts msg
View commit.diff
commit 06c98bcc273915737b4e0751fa4be1a32727087b
Author: James Cartledge <>
Date: Mon May 12 11:36:26 2014 +1000
tweak study area import script:
1. correctly associate topics, study areas and related study areas
2. correctly associate study areas with courses
diff --git a/src/drupal/sites/all/modules/custom/vu_courses/modules/vu_course_study_areas/vu_course_study_areas.install b/src/drupal/sites/all/modules/custom/vu_courses/modules/vu_course_study_areas/vu_course_study_areas.install
View gist:6819925
diff --git a/config.rb b/config.rb
index 7b9f9b3..e8dcf6f 100644
--- a/config.rb
+++ b/config.rb
@@ -24,3 +24,9 @@ configure :build do
# Or use a different image path
# set :http_path, "/Content/images/"
+helpers do
jcartledge / partial.php
Created Jul 22, 2013
Partial application and function composition in PHP.
View partial.php
* Decorate a function so it can be partially applied.
* If the resulting function is called with fewer than the required
* number of arguments a new function is returned with the supplied
* arguments applied.
* See examples below.
jcartledge / set.class.php
Last active Dec 19, 2015
PHP immutable set
View set.class.php
function set() {
return new Set(func_get_args());
class Set implements Countable, Iterator {
private $data = array();
function __construct($data) {
You can’t perform that action at this time.