Skip to content

Instantly share code, notes, and snippets.

View affix's full-sized avatar
:shipit:
Code never lies, Comments might though

Keiran Smith affix

:shipit:
Code never lies, Comments might though
View GitHub Profile
wifi.setmode(wifi.STATION)
wifi.sta.config("SSID","PASSWORD")
print(wifi.sta.getip())
outpin=4 -- Connect Relay trigger to pin D4
-- Relay powered from 3V pin
srv=net.createServer(net.TCP) srv:listen(80,function(conn)
conn:on("receive",function(conn,payload)
# Call Of Duty API Login
# Written by Keiran Smith <affix_at_affix_dot_me>
# (c) 2014 Keiran Smith
# This is not licensed via Activision or any other
# official call of duty publishers
# If I reveive a DMCA I will remove.
# Licenced under GNU/GPLv3
require 'uri'
require 'net/http'
@affix
affix / tpbbot.rb
Last active October 14, 2016 10:29
A simple Pirate Bay Scraper that only scrapes a single page
#!/usr/bin/env ruby
# Simple Pirate Bay Parser
# Checks the results page and lists torrents and info
# Also gives Magnet link
# (c) 2016 Keiran Smith
# Licensed under gnu/gplv3
require 'nokogiri'
require 'open-uri'
@affix
affix / QRGen.swift
Created October 16, 2016 12:47
View Controller to Generate a QR Code with swift on macOS. Requires a NSImageView, NSTextField and NSButton
//
// ViewController.swift
// QRGen
//
// Created by Keiran Smith on 01/10/2016.
// Copyright © 2016 Keiran Smith. All rights reserved.
//
import Cocoa
import CoreImage
[
{
"name": "Afghanistan",
"code": "AF"
},
{
"name": "Åland Islands",
"code": "AX"
},
{

Keybase proof

I hereby claim:

  • I am affix on github.
  • I am affix (https://keybase.io/affix) on keybase.
  • I have a public key ASA4Cd2H8oxYYN_zve4TDWfADj1rArl11UD5HVhA-89wZgo

To claim this, I am signing this object:

@affix
affix / UpdateASGroup.rb
Last active July 15, 2018 19:23
A ruby script to update your AutoScaling Group by taking an image of an existing instance
#!/usr/bin/env ruby
# UpdateASGroup.rb
# Update AutoScaling Group with a new Image based from an running Instance
# (c) 2018 Keiran Smith <opensource_at_keiran.scot>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@affix
affix / affix-cloud
Created August 18, 2018 09:27
OpenFaaS Cloud affix customers
affix
alexellis
#!/usr/bin/env ruby
# GNU/GPL V3+
# Lights used are George Home 20 String Lights
# ASDA LED-20-BO (coloured) LED-20-BO-W (White/Clear)
require 'wiringpi'
puts "Pi Christmas Lights"
puts "Written by Affix"
puts "Created using ASDA George home 20 Battery string lights"
@affix
affix / kubectl-updatedotoken.rb
Last active June 9, 2019 12:50
Automatically Update your kubernetes config with the DigitalOcean API and Ruby
#!/usr/bin/env ruby
# DO Kubernetes Config Auto Updater
# Automatically Update your kubeconf using the DigitalOcean api
#
# Get $50 DigitalOcean Credit :: https://m.do.co/c/d755c35183a9
#
# (c) 2019 Keiran Smith <opensource_at_keiran_dot_scot>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal