Skip to content

Instantly share code, notes, and snippets.

View tonyklawrence's full-sized avatar

Tony Lawrence tonyklawrence

View GitHub Profile
@tonyklawrence
tonyklawrence / freeagent.sh
Created March 29, 2019 11:48
Convert Starling CSV to FreeAgent CSV format
sed 1,2d sample.csv | awk 'BEGIN { FS=","; OFS=","; } {print $1,$5,$3}'
@tonyklawrence
tonyklawrence / docker-compose.yaml
Last active August 26, 2019 07:08
Docker Compose Example
version: '2'
services:
first:
...
mac_address: d0:ca:4a:99:02:00
networks:
some_network_name:
ipv4_address: 192.168.1.200
second:
@tonyklawrence
tonyklawrence / gist:b477dcf624577ab154ed3b51cea60e27
Last active April 12, 2023 17:10
Docker containers using VLAN network on Synology DSM 6.X
First we need to create the VLAN on the Synology from the command line:
See: https://nielshagoort.com/2016/03/30/synology-vlan-tagging/
Then add Network to Docker using maclvan driver
See: https://docs.docker.com/engine/userguide/networking/get-started-macvlan/#macvlan-8021q-trunk-bridge-mode-example-usage
Details...

Keybase proof

I hereby claim:

  • I am tonyklawrence on github.
  • I am tonylawrence (https://keybase.io/tonylawrence) on keybase.
  • I have a public key ASDTjtFgrNwj3uNzjJWCq9mYYLBt8bQzpHh9ZTmjd0xV6go

To claim this, I am signing this object:

=> ⇒
<- ←
@tonyklawrence
tonyklawrence / environments.rb
Created November 22, 2013 09:04
Evironments Dashing Widget
require 'net/http'
require 'json'
environments = {}
SCHEDULER.every '30s' do
status = 'good'
environments['Prod'] = { label: 'Production', value: health('http://prod/openapi/dashboard/health') }
environments['UAT'] = { label: 'User Testing', value: health('http://suat/openapi/dashboard/health') }
environments['Dev'] = { label: 'Development', value: health('http://dev/openapi/dashboard/health') }
class Dashing.Workitems extends Dashing.Widget
@accessor 'current', Dashing.AnimatedValue
onData: (data) ->
if data.status
$(@get('node')).attr 'class', (i,c) -> c.replace /\bstatus-\S+/g, ''
$(@get('node')).addClass "status-#{data.status}"
@tonyklawrence
tonyklawrence / teamcity.coffee
Last active December 29, 2015 01:59
Dashing Teamcity Widget
class Dashing.Teamcity extends Dashing.Widget
@accessor 'state', Dashing.AnimatedValue
onData: (data) ->
if data.status
$(@get('node')).attr 'class', (i,c) -> c.replace /\bstatus-\S+/g, ''
$(@get('node')).addClass "status-#{data.status}"
List<Integer> numberList = asList(1, 2, 3, 4, 5);
// old style
transform(numberList, byHalf());
// fluent interface
FluentIterable numbers = from(numberList);
numbers.transform(byHalf());
// assume byHalf() returns us a Guava Function<Integer,Integer>