I hereby claim:
- I am photomattmills on github.
- I am photomattmills (https://keybase.io/photomattmills) on keybase.
- I have a public key ASBBytkh8zctHRIoX_HFkpdTZr9lEDYqW9spWaAoxUEZhAo
To claim this, I am signing this object:
/** | |
* USB HID Keyboard scan codes as per USB spec 1.11 | |
* plus some additional codes | |
* | |
* Created by MightyPork, 2016 | |
* Public domain | |
* | |
* Adapted from: | |
* https://source.android.com/devices/input/keyboard-devices.html | |
*/ |
I hereby claim:
To claim this, I am signing this object:
So, you want to calculate some arbitrary date things? Easy! Let's use IRB! Open up the terminal (don't worry, there aren't any dragons here unless you've brought them). Then type irb
and hit enter. it should bring up another prompt that looks something like this:
> irb
irb(main):001:0>
’Twas brillig, and the slithy git repos | |
Did gyre and gimble in the wecks: | |
All mimsy were the borogoves, | |
And the mome raths Mutex. | |
“Beware the legacy code, my son! | |
The classes that bite, the patches that catch! | |
Beware the Gemfile.lock, and shun | |
The frumious monkey patch!” |
require 'net/http' | |
require 'open-uri' | |
require 'csv' | |
uri = URI('http://xi.hope.net/schedule.html') | |
html = Net::HTTP.get(uri) | |
entries = html[2601..-1752].split('<h3') | |
CSV.open("/tmp/schedule.csv", "wb")do |csv| |
require 'typhoeus' | |
require 'json' | |
require 'uri' | |
domain = 'https://silver-jellyfish.rmq.cloudamqp.com/' | |
#get your username and password and put them here | |
userpass = "user:pass" | |
connections_req = Typhoeus::Request.get("#{domain}api/connections", userpwd: userpass ) | |
connections = JSON.parse(connections_req.body) |
#! /usr/bin/env bash | |
# put this somewhere in your $PATH, and enjoy! most of the regex was @cczona, and the sort | uniq was me. | |
whois $1 | sed "s/^ *//g" | grep -i -v "^(Please|Billing|Admin|Tech|register|\d\|>>>|Registr|Sponsoring)|whois" | grep ":" | grep -v "^(with|NOTICE|by the|to:|please)" | sort -f | uniq -i |
/* | |
Joystick Mouse Control | |
Controls a PC mouse from a joystick on an Arduino Micro. Adapted from | |
Adafruit's code for the Pro Trinket (https://learn.adafruit.com/pro-trinket-usb-hid-mouse/example-joystick-mouse) | |
by Matt Mills. Released under the same license, GPLv3. | |
Uses the joystick pushbutton to click the left mouse button | |
Hardware: | |
* 2-axis joystick connected to pins A0 and A1 with pushbutton on D10 |
#! /Users/matt/.rvm/rubies/ruby-2.2.1/bin/ruby | |
class Foo | |
attr_accessor :bar | |
def initialize | |
puts "initialized" | |
@bar = 5 | |
end |