Skip to content

Instantly share code, notes, and snippets.

View ar1a's full-sized avatar

aria ar1a

View GitHub Profile
@ar1a
ar1a / sedbot.rb
Created July 30, 2017 07:29
Sed bot for discord
require 'discordrb'
require_relative 'cbuffer'
bot = Discordrb::Bot.new(
token: '',
client_id: 341_071_434_644_455_426
)
sed = RingBuffer.new 20
bot.message do |event|
#!/usr/bin/env ruby
# Copyright 2017 Aria
# 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:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWA
require 'nokogiri'
require 'http'
parse = Nokogiri::HTML(HTTP.get('https://www.ozbargain.com.au/deals/dominos.com.au').to_s)
parse.css('.domaincoupons li').each do |coupon|
code = coupon.children[1].children[1].children[0]
deal = coupon.children[3].children[0].children[0]
puts "#{code} - #{deal}"
end
@ar1a
ar1a / seatfinder.rb
Last active July 7, 2017 15:14
RFlan seat helper
require 'json'
require 'open-uri'
require 'fuzzy_match'
module SeatFinder
extend self
def update!
data = JSON.parse open("http://www2.rflan.org/floorplanner/getReducedState.php").read
require 'json'
require 'open-uri'
module SeatFinder
extend self
def update!
data = JSON.parse open("http://www2.rflan.org/floorplanner/getReducedState.php").read
@teams = {}
require 'pp'
require 'json'
require 'open-uri'
Dir["./lib/normalizr/*.rb"].each { |file| require file }
module SeatFinder
extend self
public
normalizr.rb-0.3.3
normalizr.rb-0.3.3/lib
normalizr.rb-0.3.3/lib/normalizr
normalizr.rb-0.3.3/lib/normalizr/array_of.rb
normalizr.rb-0.3.3/lib/normalizr/bag.rb
normalizr.rb-0.3.3/lib/normalizr/normalizr.rb
normalizr.rb-0.3.3/lib/normalizr/schema.rb
require 'pp'
require 'json'
require 'open-uri'
require 'normalizr.rb'
module SeatFinder
extend self
public
Timer = React.createClass
getInitialState: ->
secondsElapsed: 0
tick: ->
@setState secondsElapsed: @state.secondsElapsed + 1
componentDidMount: ->
setInterval @tick, 1000
render: ->
React.DOM.div null, "Seconds elapsed: " + @state.secondsElapsed
#!/usr/bin/env ruby
# Copyright 2017 Aria
# 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:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWA