Skip to content

Instantly share code, notes, and snippets.

View raldred's full-sized avatar

Rob Aldred raldred

View GitHub Profile
@raldred
raldred / heroku-check-app-stacks.rb
Created February 26, 2020 12:13
Quick script to check the stack of all our apps
#!/usr/bin/env ruby
team = ARGV[0]
raise 'Specify team' unless team
check_app = Proc.new do |app|
info = %x{heroku apps:info -a #{app}}
stack = info.match(/Stack:\s+(.*)/)[1].strip
app = "#{app}:"
puts "#{app.ljust(30)} #{stack}"
@raldred
raldred / gist:098801f9ea47bd37c64652af2ef35baf
Created March 1, 2019 18:07
Homebrew completion errors
-bash: have: command not found
-bash: /usr/local/etc/bash_completion.d/ant: line 45: syntax error in conditional expression: unexpected token `('
-bash: /usr/local/etc/bash_completion.d/ant: line 45: syntax error near `-@(?'
-bash: /usr/local/etc/bash_completion.d/ant: line 45: ` if [[ "${COMP_WORDS[i]}" == -@(?(build)file|f) ]]; then'
-bash: have: command not found
-bash: /usr/local/etc/bash_completion.d/apt: line 12: syntax error in conditional expression: unexpected token `('
-bash: /usr/local/etc/bash_completion.d/apt: line 12: syntax error near `@(i'
-bash: /usr/local/etc/bash_completion.d/apt: line 12: ` if [[ ${COMP_WORDS[i]} == @(install|remove|autoremove|purge|source|build-dep) ]]; then'
-bash: /usr/local/etc/bash_completion.d/apt-build: line 12: syntax error in conditional expression: unexpected token `('
-bash: /usr/local/etc/bash_completion.d/apt-build: line 12: syntax error near `@(i'
@raldred
raldred / tasks.json
Created April 20, 2017 10:08
Example vscode task config for running Ruby RSpec
{
"version": "0.1.0",
"tasks":[
{
"command": "/Users/robaldred/.rvm/wrappers/ruby-2.4.0/bundle",
"args": [
"exec", "rspec", "--format", "progress", "--color"
],
"isTestCommand": true,
"echoCommand": true,
@raldred
raldred / location.js
Last active November 5, 2017 13:42
Location Component for react native with workaround for Android issue https://github.com/facebook/react-native/issues/7495
export default class Location extends Component {
constructor(props) {
super(props);
this._locationReceived = false;
this._locationWatchID = null;
};
componentDidMount() {
@raldred
raldred / wbus_sim900.ino
Last active October 11, 2016 16:19
Arduino WBus & SIM900
//hacked together by bo herrmannsen 2016
#include "wbus.h"
#include "SIM900.h"
#include <SoftwareSerial.h>
#include "sms.h"
SMSGSM sms;
char number[]="3921234567";
@raldred
raldred / ReplacementBuildPostprocessor.cs
Created May 25, 2016 12:16 — forked from cojo/ReplacementBuildPostprocessor.cs
Unity 5.3 PostprocessBuildPlayer Trigger Replacement
using System;
using System.IO;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
@raldred
raldred / iTween.cs
Last active July 4, 2021 07:53
Unity iTween with support for uGUI Image & Text requires 5+
// Copyright (c) 2011 Bob Berkebile (pixelplacment)
// Please direct any bugs/comments/suggestions to http://pixelplacement.com
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
@raldred
raldred / gist:6fb93d969aaede7ffe41
Last active July 29, 2022 16:20
Getting RTL SDR and dump1090 running on OSX El Capitan
# =================================================================================================
# RTL SDR & Dump1090 installation for OSX El Capitan
# =================================================================================================
# This is written as a guide for those wanting to install RTL SDR and Dump1090 for OSX El Capitan
# It may work on other versions of OSX
# I am using a R820T from Jetvision.de
# http://bit.ly/1QynTts - without antenna
# http://bit.ly/1O60IUV - with small indoor antenna
# -------------------------------------------------------------------------------------------------
# To follow this guide you will need to use the Terminal app
@raldred
raldred / user.js
Last active September 1, 2015 11:09
Digitally Imported Responsive Fix
// ==UserScript==
// @name Digitally Imported Unresponsive Fix
// @namespace http://robaldred.co.uk/
// @version 0.1
// @description Watches for the annoying unresponsive popup that's presented and resumes playback.
// @match http://www.di.fm/*
// @copyright 2015+, Rob Aldred
// ==/UserScript==
;(function(window) {
root@OpenWrt:~# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
delegate_input all -- anywhere anywhere
Chain FORWARD (policy DROP)
target prot opt source destination
delegate_forward all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)