Skip to content

Instantly share code, notes, and snippets.

View ArthurGuy's full-sized avatar

Arthur Guy ArthurGuy

View GitHub Profile
@ArthurGuy
ArthurGuy / env-json-convert.py
Created January 16, 2020 15:03
Convert a .env file to a json array
#!/usr/bin/env python
import json
import sys
try:
dotenv = sys.argv[1]
except IndexError as e:
dotenv = '.env'
with open(dotenv, 'r') as f:
@ArthurGuy
ArthurGuy / defcon-sign.ino
Created August 25, 2017 15:17
UK Security Level MI5 Defcon Sign
#include "Particle.h"
#include "neopixel.h"
SYSTEM_MODE(AUTOMATIC);
// IMPORTANT: Set pixel COUNT, PIN and TYPE
#define PIXEL_PIN D2
#define PIXEL_COUNT 120
@ArthurGuy
ArthurGuy / display.conf
Last active August 10, 2017 12:32
YouTube sign counter
[program:display]
command=python /home/pi/youtube.py
autostart=true
autorestart=true
stderr_logfile=/var/log/youtube.err.log
stdout_logfile=/var/log/youtube.out.log
user=root
#include "FastLED.h"
#include <CapacitiveSensor.h>
// How many leds in your strip?
#define NUM_LEDS 130
// What pin are the LED's connected to?
#define DATA_PIN 2
// Define the array of leds
@ArthurGuy
ArthurGuy / README.MD
Created February 10, 2017 18:51
Raspberry Pi - Start on Boot

File: /etc/rc.local

Execute command such as

  cd /home/pi/app/;
  git pull;
  node /home/pi/app/app.js > /dev/null &
@ArthurGuy
ArthurGuy / vestd-stylebot-fixes
Created August 17, 2016 14:19
Style fixes for Vestd
{"vestd.dev, vestd.com":{"_enabled":true,"_rules":{".text-muted, .page-title p, .text-light-greyish-turquoise, .text-lighter-grey, .navbar-default .dropdown-menu li a, .card-item .card-item-body .card-item-body-meta":{"color":"#333"},"body":{"color":"#333"},".well":{"background-color":"#fafafa","box-shadow":"none"}}}}
@ArthurGuy
ArthurGuy / member-agreement.md
Last active November 27, 2015 11:23
Build Brighton Member Agreement

There are a few things we ask members to remember. This helps keep the space and our equipment easy for all members to use, and promotes harmony among members.

  • Please return all tools and stuff you’ve used back to their proper places when done.
  • Please keep all of the space clean and tidy by cleaning up any mess such as sawdust, putting things away, clearing/washing dirty dishes and throwing scrap in the bin.
  • If you find a mess, it is a big help to everyone to clean and tidy. Just occasionally, someone forgets to tidy something or clean up.
  • Please leave the space tidier than it was when you started work
  • Before using tools, make sure you understand how to use them. Ask someone if unsure. Instruction manuals are online under each tool in "Tools and Equipment".
  • Read the hazard warning notices on tools and other Build Brighton notices and heed them - they are there for a reason. Re-read them from time to time. The hazard warning notices and risk assessments are online in "Tools and Equipment".
  • Some

####Accessing an active container docker exec -t -i [container-id] /bin/bash

####Running an image docker run -v ~/Code/BBMS/:/var/www:rw -p 80:80 -d [image name] /sbin/my_init --enable-insecure-key

####Images

@ArthurGuy
ArthurGuy / doctrine-multiple-objects.php
Last active August 27, 2015 12:30
Moving from Eloquent to Doctrine
<?php
/** @var \Illuminate\Http\Request $request */
$cost = new EquipmentCost($request->get('requires_induction'), $request->get('induction_category'), $request->get('access_fee'), $request->get('usage_cost'), $request->get('usage_cost_per'));
$properties = new EquipmentProperties($request->get('manufacturer'), $request->get('model_number'), $request->get('serial_number'), $request->get('colour'));
$ownership = new Ownership($request->get('managing_role_id'), $request->get('permaloan'), $request->get('permaloan_user_id'));
$device = new Device($request->get('name'), $request->get('key'), $request->get('description'), $request->get('help_text'), $properties, $cost, $ownership, $request->get('obtained_at'));
int pin3 = 2; //£1
int pin4 = 3; //£2
int pin5 = 4; //input - coin return
int pin6 = 5; //high - stops money
int pin7 = 6; //5p
int pin8 = 7; //10p
int pin9 = 8; //20p
int pin10 = 9;//50p