Skip to content

Instantly share code, notes, and snippets.

@jcartledge
jcartledge / batect-colima.md
Last active August 25, 2022 04:00
switching batect from docker desktop to colima

switching batect from docker desktop to colima

assumptions:

  • you already have a working docker client (brew install docker)
  • you have uninstalled docker desktop (e.g. brew uninstall —force —cask docker)

instructions

  1. install colima and docker-credential-helper:

brew install colima docker-credential-helper

import React from 'react';
import {Switch, Link, Route, HashRouter} from 'react-router-dom';
import {Modal, Button} from 'react-bootstrap';
const UserModal = () => {
return (
<Modal.Dialog>
<Modal.Header>
<Modal.Title>
<Switch>
@jcartledge
jcartledge / setup.sh
Last active December 31, 2017 23:16
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

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
commit 06c98bcc273915737b4e0751fa4be1a32727087b
Author: James Cartledge <jcartledge@gmail.com>
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
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/"
end
+
+helpers do
#times-tools, hr {
display: none;
}
@jcartledge
jcartledge / partial.php
Created July 22, 2013 23:31
Partial application and function composition in PHP.
<?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.