Skip to content

Instantly share code, notes, and snippets.

@mcoms
mcoms / late_invoices.csv
Created January 21, 2019 12:41
Takes the FreeAgent invoice table and generates a CSV file from it. Makes it easier to work with the data in a spreadsheet when calculating late payment fees.
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 7 columns, instead of 1. in line 1.
Issue Date,Due Date,Name,Client,Value,Status,Paid On
...
@mcoms
mcoms / custom_formatter.rb
Created June 12, 2017 20:07
When you're having a bad day and just want to skip every failing RSpec test
# frozen_string_literal: true
class CustomFormatter
RSpec::Core::Formatters.register self, :example_failed
def initialize(output)
@output = output
end
def example_failed(notification)
@mcoms
mcoms / Gemfile
Created June 6, 2017 18:29
Train a Markov chain on your tweets so you don't have to think of tweets anymore
# frozen_string_literal: true
source 'https://rubygems.org'
gem 'marky_markov', '~> 0.3.5'
gem 'twitter', '~> 6.1.0'
@mcoms
mcoms / Dockerfile
Created June 23, 2016 16:29
Dockerfile and docker-compose for Traccar GPS software
FROM java:alpine
RUN mkdir -p /usr/src/traccar
COPY . /usr/src/traccar
VOLUME /usr/src/traccar/data
WORKDIR /usr/src/traccar
EXPOSE 8082
EXPOSE 5001-5109
CMD ["java", "-jar", "tracker-server.jar", "conf/traccar.xml"]
@mcoms
mcoms / README.md
Created May 17, 2016 21:50
Eken H9 Action Camera Firmware

Official source for the latest firmware

Eken supply firmware for their H2, H2R, H3, H3R, H8, H8R, H9 and H9R cameras via the following site:

http://ftp.eken.com/

The "R" camera versions come with a remote control.

Selecting the right file

@mcoms
mcoms / Dockerfile
Created October 20, 2015 12:56
Elixir Dockerfile (en_GB.UTF-8)
FROM debian:latest
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq wget locales
RUN dpkg-reconfigure locales && \
locale-gen C.UTF-8 && \
/usr/sbin/update-locale LANG=C.UTF-8
RUN echo 'en_GB.UTF-8 UTF-8' >> /etc/locale.gen && \
locale-gen
ENV LC_ALL C.UTF-8
@mcoms
mcoms / boot-sonic-pi.sh
Created May 28, 2015 21:55
MPR121 Fruit Piano (Pi-only version)
#!/bin/bash
eval $(dbus-launch --auto-syntax)
/opt/sonic-pi/app/server/bin/sonic-pi-server.rb
@mcoms
mcoms / Gemfile
Created May 6, 2015 22:42
Fruit Piano prototype with MPR121, Arduino and Sonic Pi
source 'https://rubygems.org'
gem 'osc-ruby', '1.1.1'
gem 'serialport'

Keybase proof

I hereby claim:

  • I am mcoms on github.
  • I am mcoms (https://keybase.io/mcoms) on keybase.
  • I have a public key whose fingerprint is 7A08 89B7 BD6A 2DF7 4716 2FBD 8F2D 8965 5AF4 E06A

To claim this, I am signing this object:

@mcoms
mcoms / helper.rb
Last active August 29, 2015 14:11
Morse code bitstream
def bitstream_to_text(bitstream)
bitstream.join.gsub('111', '-').gsub('1', '.').gsub('0',' ')
end