Skip to content

Instantly share code, notes, and snippets.

View Teqqles's full-sized avatar

David Long Teqqles

View GitHub Profile
@Teqqles
Teqqles / install_py_36.md
Created March 2, 2018 13:02
Install Python 3.6 + PIP on Ubuntu 14.04/16.04
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.6

curl https://bootstrap.pypa.io/get-pip.py | sudo python3.6
@Teqqles
Teqqles / grc-col.md
Last active August 5, 2021 13:08
Setting Up GRC for colourised output of golang tests

Install GRC

brew install grc

Create a config directory in your home directory:

mkdir ~/.grc
@Teqqles
Teqqles / IrFlag.js
Last active June 16, 2021 17:01
Custom SimHub serial device script for IR controlled flag lights. Written primarily for ACC
// property table
var propsFlagAssociation = [
// property, flag short code
['GameRawData.Graphics.globalWhite', 'W'],
['Flag_White', 'W'],
['Flag_Green', 'G'],
['Flag_Orange', 'O'],
['Flag_Blue', 'B'],
['GameRawData.Graphics.globalYellow', 'Y'],
@Teqqles
Teqqles / UnTarFile.scala
Created January 20, 2016 13:26
Quick and dirty decompression of a tar gzip file using Apache Commons Compress and Scala
import java.io.{File, FileOutputStream, BufferedOutputStream, InputStream}
import org.apache.commons.compress.archivers.tar.{TarArchiveEntry, TarArchiveInputStream}
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream
object UnTarFile {
val BUFFER = 2048
def untar( in: InputStream, destinationDir: String ) {
def processTar( tarIn: TarArchiveInputStream ): Unit = {
def processFileInTar( dest: BufferedOutputStream ): Unit = {
@Teqqles
Teqqles / Dockerrun.aws.json
Created July 19, 2019 21:47
How Many Meeple Setup
{
"AWSEBDockerrunVersion": "2",
"containerDefinitions": [
{
"name": "how-many-meeple",
"image": "docker.io/howmanymeeple/how-many-meeples:v1.1.0",
"essential": true,
"memory": 256,
"portMappings": [
{
@Teqqles
Teqqles / SFS_WorldspaceTiling.scala
Created September 25, 2018 07:35
Tile an object independent of its size in Unity
Shader "SixfootSoftware/Unlit/WorldspaceTiling"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
@Teqqles
Teqqles / SFS_Footprint.shader
Last active September 24, 2018 22:09
Glowing shader with a wave of coloured intensity scrolling through a primary texture (for use in a VR title)
Shader "SixfootSoftware/Unlit/Footprint" {
Properties{
_MainTex("Base (RGB)", 2D) = "white" {}
_GlowTex("Base (RGB)", 2D) = "white" {}
_Color("Colour", Color) = (1,1,1,1)
_ScrollSpeed("Scroll Speed", Range(-50,50)) = 0
}
SubShader{
Tags { "RenderType" = "Opaque" "Queue" = "Geometry+1" "ForceNoShadowCasting" = "True" }
LOD 200
@Teqqles
Teqqles / add_gradient_to_image.py
Created May 10, 2018 23:22
Adding a diagonal gradient to a PIL image - implemented in a hack day
from PIL import Image
import math
def gradient_fill(im, from_color, to_color):
start_x = 0
start_y = 0
pixel_data = im.load()
for x in range(im.size[0]):
for y in range(im.size[1]):
kill -9 $(ps ax|grep gunicorn| awk '{print $1}')
@Teqqles
Teqqles / firefox_57_on_pi.sh
Created March 2, 2018 21:48
Getting Firefox 57 installed and working on Raspberry PI 3
wget http://launchpadlibrarian.net/352602073/firefox_57.0.4+build1-0ubuntu0.14.04.1_armhf.deb
dpkg -i firefox_57.0.4+build1-0ubuntu0.14.04.1_armhf.deb
echo 'user_pref("gfx.content.azure.backends", "");' >> ~/.mozilla/firefox/*.default/prefs.js