Skip to content

Instantly share code, notes, and snippets.

View willmcclellan's full-sized avatar

Will McClellan willmcclellan

  • Lighthouse
  • Melbourne
View GitHub Profile
const groupMachine = Machine({
id: 'group',
initial: 'active',
context: {
"totalUserCount": 1,
"expiredCount": 0,
"roleId": "",
"nextStartAt": "2021-06-08T11:00:00.000Z",
"expiresAt": "",
@willmcclellan
willmcclellan / machine.js
Last active June 3, 2021 02:02
Generated by XState Viz: https://xstate.js.org/viz
const authMachine = Machine({
id: 'auth',
initial: 'unauthenticated',
context: {
tenantId: null,
sharedUser: null,
},
states: {
unauthenticated: {
on: {
@willmcclellan
willmcclellan / magit.sh
Created August 17, 2019 05:13 — forked from alphapapa/magit.sh
Run a standalone Magit editor!
#!/bin/bash
# Run a standalone Magit editor! To improve startup speed, this
# script ignores the user's Emacs init files and only loads the Emacs
# libraries Magit requires.
# Note that this does NOT install any packages. Magit and its
# dependencies must already be installed in ~/.emacs.d.
dependencies=(magit async dash with-editor git-commit transient)
@willmcclellan
willmcclellan / logstash.conf
Last active August 29, 2015 14:15
Test conf for logstash
input {
# Sample input over TCP
tcp { port => 9200 type=>"sample" }
}
output {
stdout { debug => true }
}
filter {
json {
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
// http://stackoverflow.com/questions/72768/how-do-you-detect-credit-card-type-based-on-number
this.getCreditCardType = function(number) {
if (!number) {
return undefined;
};
// trim whitesapce
number = number.replace(/\s+/g, '');

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@willmcclellan
willmcclellan / http-https-htaccess
Created September 18, 2012 17:46
https to http and vice versa .htaccess
# Enable Rewrite Engine
RewriteEngine On
RewriteBase /
# http: rewrite rule to secure sections (redirect to https)
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} ^(/directoryA(.*)$|/directoryB(.*)$)$
RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
# http: rewrite rule for other pages (redirect to http)