Skip to content

Instantly share code, notes, and snippets.

@jcartledge
jcartledge / README.md
Created December 1, 2012 13:01 — forked from agnoster/README.md
Agnoster zsh theme with subtler colours and git 'no unstaged changes' state.

Fork of agnoster.theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

See the original gist for more details.

@jcartledge
jcartledge / ~_.config_terminator_config
Created April 27, 2011 04:31
terminator config solarized
[global_config]
title_transmit_bg_color = "#839496"
title_inactive_fg_color = "#93a1a1"
title_transmit_fg_color = "#eee8d5"
title_inactive_bg_color = "#586e75"
[keybindings]
[profiles]
[[default]]
palette = "#073642:#d30102:#859900:#b58900:#6c71c4:#d33682:#2aa198:#839496:#586e75:#cb4b16:#859900:#b58900:#268bd2:#d33682:#2aa198:#93a1a1"
login_shell = True
@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

@jcartledge
jcartledge / bash.sh
Created September 30, 2012 13:17
My git prompt is better than any other one I've seen anywhere.
# prompt
function _git_prompt() {
local git_status="`git status -unormal 2>&1`"
if ! [[ "$git_status" =~ Not\ a\ git\ repo ]]; then
if [[ "$git_status" =~ Changed\ but\ not\ updated ]] || [[ "$git_status" =~ Untracked\ files ]] || [[ "$git_status" =~ Changes\ not\ staged ]] || [[ "$git_status" =~ Unmerged\ paths ]]; then
local color="0;31" # red
elif [[ "$git_status" =~ Changes\ to\ be\ committed ]]; then
local color="0;32"
else
local color="1;32"
@jcartledge
jcartledge / set.class.php
Last active August 9, 2020 18:25
PHP immutable set
<?php
function set() {
return new Set(func_get_args());
}
class Set implements Countable, Iterator {
private $data = array();
function __construct($data) {
@jcartledge
jcartledge / ll.js
Created July 1, 2013 01:31
Simple JavaScript implementation of cons list with lazy evaluation of map, filter etc.
// Basic cons list.
// Elements are defined as functions so we can have lazy sequences.
function cons(x, xs) {
return {
head: function() { return x; },
tail: typeof xs === 'function' ? xs : function() { return xs; }
};
}
function isEmpty(xs) { return xs === undefined; }
@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
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 / FUJI-XEROX-ApeosPort-IV-C3370.sh
Created May 9, 2011 04:23
What I did to get our new office MFD installed in Ubuntu
#!/bin/bash
# n.b. I haven't tested this version - see comments at https://gist.github.com/gists/962048
# download the driver rpm
wget http://download.fujixerox.co.jp/pub/exe/apeosport/c4300series/fxlinuxprint-1.0.3-2.i386.rpm
# alien will convert the rpm to a deb we can install
sudo aptitude install alien
sudo alien --scripts -k fxlinuxprint-1.0.3-2.i386.rpm
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