Skip to content

Instantly share code, notes, and snippets.

View andypearson's full-sized avatar

Andy Pearson andypearson

View GitHub Profile
@andypearson
andypearson / paint-ranges.md
Last active February 2, 2023 19:34
A list of paint ranges that need to be added to Paint Pad
@andypearson
andypearson / gist:11bc798a168df2f7801d72cfe9d6643a
Created July 26, 2019 15:38
Paint Pad recipe converted to plain text
T'au troops
===========
Method
------
Undercoat with Mechanicus Standard Grey
### Undersuit
@andypearson
andypearson / article50-petition-count.10s.sh
Created March 21, 2019 14:07
BitBar plugin for showing latest signature count of Revoke Article 50 and remain in the EU petition
#!/usr/bin/env ruby
require 'json'
require 'open-uri'
json = JSON.parse(open("https://petition.parliament.uk/petitions/241584/count.json").read, symbolize_names: true)
puts json[:signature_count].to_s.chars.to_a.reverse.each_slice(3).map(&:join).join(",").reverse
puts "---"
puts "View petition | href=https://petition.parliament.uk/petitions/241584"
@andypearson
andypearson / functions.sh
Last active October 18, 2016 21:49
Print SimpleCov last run percentage in "good" message
# Cucumber
function c {
if [ -f "./bin/docker/cucumber" ]; then
echo "Running bin/docker/cucumber..."
command bin/docker/cucumber $@
elif [ -f "./bin/cucumber" ]; then
echo "Running bin/cucumber..."
command bin/cucumber $@
else
echo "Running bundle exec cucumber..."
@andypearson
andypearson / film-list.md
Last active August 29, 2015 14:23
Films

Films that I haven't watched

  • Black Pond
  • Enternal sunshine of a spotless mind
  • Tyrannosaurus
  • Take Shelter
  • Life of Brian
  • Meaning of Life
  • Search for the Holy Grail
  • Shame
var myInstance = (function() {
var privateVar = '';
function privateMethod () {
alert(myInstance.public_var);
}
return { // public interface
public_var : 'Here',
publicMethod1: function () {
// all private members are accessible here
// access public methods and variables using the singleton name
Abstract.build('#multi .canvas', 300, 200, function(canvas) {
colours = ['red', 'blue', 'yellow', 'black', 'white'];
canvas.origin({ x : [0, '100%'], y : [0, '100%'] });
canvas.background(colours);
canvas.repeat([5, 25], function() {
canvas.rectangle({ size : [10, 100], fill : colours });
});
<?php
echo $form->build('/booking',
$form->fieldset(
$element->build('header',
$element->build('h3', 'Outbound Drop Off Booking Request'),
$form->input('return', array('as' => 'boolean', 'label' => 'Tick if you require collection on your return'))
),
var Interface = {
init : function()
{
$('#interface').append(new Interface.Button('Button 1', function() {
alert('Button 1 has been pressed!');
}).element());
$('#interface').append(new Interface.Button('Button 2', function() {
alert('Button 2 has been pressed!');
// create a button
var my_button = new Interface.Button('Button 1');
// add it to the DOM
$('#interface').append(my_button);
console.log(my_button); // display element within the DOM
// change the label
my_button.label = 'Updated Button!'; // or my_button.label('Updated Button!');