Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/inline" | |
gemfile do | |
source "https://rubygems.org" | |
gem "aws-sdk-s3" | |
gem "benchmark-ips" | |
end | |
S3_BUCKET_NAME="" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/inline" | |
gemfile do | |
source "https://rubygems.org" | |
gem "http" | |
gem "nokogiri" | |
end | |
url = "https://howlongtobeat.com/search_results" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "graphql/client" | |
require "graphql/client/http" | |
API_TOKEN = "<TOKEN>" | |
HTTP = GraphQL::Client::HTTP.new("https://api.github.com/graphql") do | |
def headers(context) | |
{ "Authorization": "bearer #{API_TOKEN}" } | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HOST_REGEX = /(\d+.\d+.\d+.\d+)\s(\w\w:\w\w:\w\w:\w\w:\w\w:\w\w)\s(.*)/ | |
result = `sudo arp-scan -l` | |
hosts = result.scan(HOST_REGEX) | |
hosts.each do |host| | |
puts host.to_s | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This part is pretty much optional. The same error would be raised if we wouldn't define the | |
# method here, but I would definitely put something here to signal other what methods are | |
# needed in the subclasses. Just doing it with comments would be feasible, too. | |
class Answer < ActiveRecord::Base | |
def label | |
raise NoMethodError, %(undefined method "label" for ##{self.class.name}) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: UTF-8 | |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'roo' | |
# Original script: https://github.com/scpike/excel2csv | |
USAGE = <<END | |
Convert an excel file to csv via the roo library |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# Brett Terpstra 2013, WTF license <http://www.wtfpl.net/txt/copying/> | |
# Outputs a vertical bar chart from date-based JSON data | |
# Requires the JSON rubygem: `[sudo] gem install json` | |
require 'date' | |
require 'open-uri' | |
require 'rubygems' | |
require 'json' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# disable local bluetooth | |
blueutil off | |
# enable imac's bluetooth | |
ssh [email protected] '/usr/local/bin/blueutil on' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'audioinfo' | |
if ARGV.size >=1 | |
ARGV.each do |path| | |
length = AudioInfo.open(path) { |info| info.length } | |
puts File.basename(path) + ": #{length}" | |
end |