Skip to content

Instantly share code, notes, and snippets.

🙂
We'll get there

Brittan McGinnis konamax123

🙂
We'll get there
Block or report user

Report or block konamax123

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@konamax123
konamax123 / contactform.js
Created Oct 17, 2015 — forked from insin/contactform.js
React contact form example
View contactform.js
/** @jsx React.DOM */
var STATES = [
'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI',
'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS',
'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR',
'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'
]
var Example = React.createClass({
View request-body-1.json
{
"OfferID":876,
"OfferValues":[
{
"key":"first-name",
"value":"Some"
},
{
"key":"last-name",
"value":"Guy"
@konamax123
konamax123 / can't share
Created Sep 15, 2013
publickey description
View can't share
OpenSSH_5.9p1, OpenSSL 0.9.8x 10 May 2012
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to github.com [192.30.252.131] port 22.
debug1: Connection established.
debug1: identity file /Users/brittmcginnis/.ssh/id_rsa type -1
debug1: identity file /Users/brittmcginnis/.ssh/id_rsa-cert type -1
debug1: identity file /Users/brittmcginnis/.ssh/id_dsa type -1
debug1: identity file /Users/brittmcginnis/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1+github5
View gist:7764627
def grab_ssn(string)
ssn = /\d{3}-\d{2}-\d{4}/.match(string).to_s
if string.include?(ssn)
return ssn
else
return nil
end
end
@konamax123
konamax123 / Die
Created Dec 6, 2013
Implement a basic Die class which can be initialized with some number of sides. We can then roll the die, returning a random number. It should work like this: die = Die.new(6) die.sides # returns 6 die.roll # returns a random number between 1 and 6 If we pass Die.new a number less than 1, we should raise an ArgumentError. This is done using the …
View Die
class Die
def initialize(sides)
# code goes here
@sides = sides
if sides < 1
raise ArgumentError.new("Please input a number 1 or larger.")
end
end
def sides
@konamax123
konamax123 / gist:7884072
Created Dec 10, 2013
The code from my 1.2 pairing with Zohar and Maria.
View gist:7884072
# Compare Fibonacci!
# At this point you should be good at refactoring your code to make it better,
# but do you feel comfortable determining "good" vs. "bad" code? In this exercise
# you will evaluate four different solutions to the same challenge and evaluate
# their clarity, effectiveness, and overall "good"ness.
# By the end of this challenge, you should be able to:
# 1) Confidently read other people's code and figure out how it works
# 2) Recognize good and not so good practices
# 3) Consider ways to improve solutions
@konamax123
konamax123 / Credit Card class
Created Dec 13, 2013
Not quite sure why this will not raise an error when the number passed in is > or < 16.
View Credit Card class
class CreditCard
def initialize(nums)
@nums = nums
end
def check_card
raise ArgumentError unless @nums.length == 16
s1 = s2 = 0
@nums.to_s.reverse.chars.each_slice(2) do |odd, even|
s1 += odd.to_i
@konamax123
konamax123 / Die class2
Last active Dec 31, 2015
This should return any random number or letter passed into the array. It does from what I can tell but it doesn't pass the specs.
View Die class2
class Die
def initialize(labels)
if labels.empty?
raise ArgumentError
end
@labels = labels
end
def sides
@labels.length
View 0.2.1-boggle_class_from_methods.rb
class BoggleBoard
def initialize
@dice_grid = [["b", "r", "a", "e"],
["i", "o", "d", "t"],
["e", "c", "l", "r"],
["t", "a", "k", "e"]]
end
def words(*coords)
@konamax123
konamax123 / shopping.rb
Last active Jan 1, 2016
Shopping list app
View shopping.rb
class List
def initialize
@items = []
end
def add_item(*var)
You can’t perform that action at this time.