Skip to content

Instantly share code, notes, and snippets.

There's nothing more permanent than a temporary hack.

Alex Flores audibleblink

There's nothing more permanent than a temporary hack.
View GitHub Profile
audibleblink / twitter.rb
Last active Aug 29, 2015
Finds the source of a retweet chain.
View twitter.rb
require 'nokogiri'
require 'httparty'
def next_tweet tweet_url
response = HTTParty.get tweet_url
tweet_link = Nokogiri::XML( response ).xpath( "//a/@data-expanded-url" ).first
p tweet_link.value unless tweet_link.nil?
def find_source url
audibleblink / dbchost
Created Mar 27, 2014
Sets host names based on HDD name
View dbchost
# Summary: Sets hostnames to volume name
set -o errexit
new_name=`diskutil list | grep "2:" | awk '{print $3}'`
sudo scutil --set ComputerName $new_name
sudo scutil --set LocalHostName $new_name
audibleblink / set_host_name
Last active Aug 29, 2015
Sets hostname on DBC machines
View set_host_name
cd /usr/local/opt/kitout/set-host-name/
unit_dir=$(cd $(dirname $0); pwd)
# Get this machine's mac address
mac_address=`ifconfig en0 | grep '\bether\b' | sed 's/.ether //'`
# Look up it's machine number
host_num=`cat $unit_dir/host-numbers-to-mac-addresses | grep '^\d' | grep $mac_address | cut -d ' ' -f 1`
test $host_num || {
echo "Skipping"
audibleblink / keybase
Created Apr 17, 2014
ID file for authing identity on keybase
View keybase
### Keybase proof
I hereby claim:
* I am audibleblink on github.
* I am serveradmin ( on keybase.
* I have a public key whose fingerprint is 787B BF72 6546 7718 7846 E543 687E F6FF F816 42CB
To claim this, I am signing this object:
View cookie clicker cheats.js
audibleblink / sudoku.rb
Last active Aug 29, 2015
Easy-level solver for sudoku
View sudoku.rb
class Sudoku
def initialize(board_string)
@board = board_string.split("")
def solve!
return self if solved?
board.each_with_index do |cell, cell_index|
# next unless cell == '0'
View binary_search.rb
# hopefully the descriptive names eliminate the need for comment
def search(collection, the_item_for_which_i_am_searching, the_lower_bounds=0, the_upper_bounds=collection.length)
the_middle_index = (the_lower_bounds + the_upper_bounds) / 2
the_middle_item = collection[the_middle_index]
return the_middle_index if the_middle_item == the_item_for_which_i_am_searching
return -1 if the_upper_bounds <= the_lower_bounds
audibleblink / list.rb
Last active Aug 29, 2015
reimplemented unix tree
View list.rb
#!/usr/bin/env ruby
# without the glyphs, if you prefer
def list entry=Dir.pwd
Dir.entries(entry)[2..-1].each do |item|
puts File.basename(item)
list("#{entry}/#{item}") if"#{entry}/#{item}")
audibleblink / fizzbuzzO.rb
Last active Dec 31, 2015
Big O practice with FizzBuzz
View fizzbuzzO.rb
def mult_generator limit, multiple
0.step(limit, multiple).to_a
def fizzbuzzify values_hash
values_hash.each_pair do |k,v|
v.each { |v| @answer[v-1] = k.to_s }
audibleblink / firstrow.js
Last active Jan 3, 2016
Minor cleanup and ad removal on
View firstrow.js
var CleanUp = {
init: function(){
stopTimers: function() {
for (var i = 1; i < 99999; i++) { window.clearInterval(i);}