Skip to content

Instantly share code, notes, and snippets.

View JesseHerrick's full-sized avatar

Jesse Herrick JesseHerrick

View GitHub Profile
@JesseHerrick
JesseHerrick / best-buy.rb
Created October 29, 2014 15:13
Basic attempt at using Best Buy's API.
require 'faraday'
require 'json'
class BestBuy
API_KEY = 'APIKEYHERE' # get one at developer.bestbuy.com
# initializes faraday and adds API key to options hash
def initialize
@options = { apiKey: API_KEY }
@JesseHerrick
JesseHerrick / gist:717ae9d8f1e694504e53
Created November 10, 2014 00:38
Get all wifi passwords.
mkdir passwds
cd passwds
netsh wlan export profile key=clear
ren *.xml *.txt
@JesseHerrick
JesseHerrick / cast.json
Last active August 29, 2015 14:09
A secret Santa name assigner.
[
// fusion
"Ashlynn Broedling",
"Ben Phipps",
"Ben Reineke",
"Danni McClendon",
"Eric Turner",
"Imani Terrell",
"Jean Joo",
"Jesse Herrick",

Keybase proof

I hereby claim:

  • I am JesseHerrick on github.
  • I am jesseg17 (https://keybase.io/jesseg17) on keybase.
  • I have a public key whose fingerprint is 4C6A B069 91E2 1130 40F9 E813 CE5E BC41 A8B6 2FDE

To claim this, I am signing this object:

@JesseHerrick
JesseHerrick / kettering-staff.rb
Last active August 29, 2015 14:15
A little Ruby script to quickly get my teacher's emails.
# Kettering Staff "API"
#
# kettering-staff.rb <LAST NAME>
#
# The MIT License (MIT)
#
# Copyright (c) 2015 Jesse Herrick
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
@JesseHerrick
JesseHerrick / write.sh
Created May 23, 2015 20:50
write() function for writing articles
#!/usr/bin/env bash
write() {
command="$@"
# run the command
$@
# special command exec stuff
case $command in
#!/usr/bin/env ruby
require 'optparse'
require 'fileutils'
DB_CONFIG=<<EOF
default: &default
hostname: localhost
adapter: postgresql
@JesseHerrick
JesseHerrick / hash_to_xml.rb
Created July 24, 2015 15:00
Because no one should have to figure out how to do this again. A recursive way to convert a Ruby hash into raw xml.
# this method is used to create a full XML structure for the Freshbooks API
# don't expect it to work for anything else
def to_xml(data_hash)
req_method = data_hash.delete(:method)
'<?xml version="1.0" encoding="utf-8"?>' +
"<request method=\"#{req_method}\">" +
hash_to_raw_xml(data_hash) +
'</request>'
end
@JesseHerrick
JesseHerrick / secret-santa.rb
Created December 4, 2015 01:23
Like drawing out of a hat, but better!
# list of people to secret santa
names = ['Foo', 'Bar', 'John', 'Jim']
raise 'not even!' if names.count % 2 != 0
def assigned?(matches, person)
matched_people = matches.values
matched_people.include? person
end