« first day (431 days earlier)      last day (2824 days later) » 

09:40
o/
wayne for president
 
3 hours later…
12:37
@BasementKeyboardHero Now there's a way to hurt a guy. What a miserable job to wish on someone.
haha!
I'd take it!
already started making hats and pins there's no turning back
I think higher office in this country should be run as a draft. It shouldn't be, "woohoo, I get to be president!". It should be "Oh dang, I gotta be president. Maybe I should move to Canada to get out of it."
hahahaha
my, albeit philosophical gripe, with hire office politics, is that there's an inherent incompatibility between ethical conduct and international relations
they're not mutually exclusive, but they hardly ever align.
12:48
I think it's a sure thing that only sociopaths seek higher office.
protecting your nations interests often involves damaging another's...
I like the way you spelled it, though: hire office. I'm going to start spelling it that way.
or maybe those with good intentions before they undergo that transformation
Maybe that too.
the job requires you to make questionable choices that don't fit nicely in our ethical model
12:49
But I think the system deliberately spits out the good. Only the corruptible make it through.
highly likely... i think egypt is a classic example... where a dictator deposed a democratically elected government, and he was allowed to do so, and curtail hard won freedoms, simply because he was a better fit for western interests in the middle east
good morning all
there's hardly any ethics there... it's all pragmatism, and "the lesser of two evils"... the right thing becomes very muddled, and i respect that
"right thing" if you will
I don't have as much respect for pragmastism. It's been used too often as an excuse to curtail rights.
Alright, off to work. Where I don't want to go. Oh, well.
indeed... the Gulf states are a prime example... hideous human rights record, yet they enjoy wester patronage
12:52
so get this, i get the requirements at 2PM the marketing team wants it done by 5PM
have a nice one!
@Nima fabulous! go you.
and i ended up writing this

def product_off_percentage(promo_requirements)
    promotion_name        = promo_requirements[:promotion_name]
    percentage            = promo_requirements[:percentage]
    required_products_sku = promo_requirements[:required_product_sku].map { |slug| Spree::Product.find_by_slug(slug).try(:skus) }.flatten
    required_line_items   = []

    required_products_sku.each do |required_sku|
      required_line_items << line_items.detect { |line_item| line_item.sku == required_sku }
WHAT A MESS
i looked at the code i wrote yesterday, now i want to shoot myself
lol
time to refactor
that many lines make my eyes hurt
there are a lot of methods to be extracted here
yea lol
this is just a horror show and it doesnt even belong in the ORDER model lo
lol*
this should be in Promotion
13:51
Great code: Whatever I just wrote. Awful code: That go-se I wrote yesterday.
14:02
Consider using #fetch instead of #[] when accessing required things from a hash. The reason is that fetch will raise an exception right then if the key is missing; #[] gives you a nil which causes a less informative exception later.
thanks Wayne
 
5 hours later…
18:49
I am about to redefine a finder for a specific column. That is, I'm going to define "self.find_by_mailing_id" on an AR model. Is that evil?
lol
My first thought was to name it something different, but it would cause a bug if someone called the original one. So that's why I'm going to clobber it.
couldnt you use default scope?
nvm that is used on all operations
omg im stuck trying to pass 1 test
19:34
wrong room x.x
lol
19:58
Consider foo.method && bar.property . What would you call the things on either side of the &&?
Conditions? Comparators?
Arguments?
operands
because && is an operator
Ahh. Thanks!
welcome!
20:16
FINALLY PASSED THE TEST!
jesus that was frustrating
Woohoo!
lol
spent 2 full days debugging it .. i was losing it ..
> products would checkout properly on localhost through the browser
> stock items would reduce properly on localhost through the browser
the same thing would FAIL in the tests
> products would checkout properly on the test
> stock items would NOT reduce properly on the test
That's maddening
it was driving me nuts lol
You seemed quite normal from this point of view. Maybe we're just used to you being nuts.
20:20
the worse is that when i would checkout the staging branch, the test would pass but in my feature branch it would randomly fail
NO CHANGES were made to the test files on staging / feature branch btw
lol
Were you able to use "git bisect" to figure out which commit caused the problem?
sigh.. i wish i would have mentioned this earlier.. i totally forgot about that
20:39
if my employer found out i spent 2 full days debugging a bug id probably get fired lol
unrealted to anything but realted to serialpodcast
http://anylytics.io/serial/
hey guys would anyone be able to help me split this string by both + and =
"post%5Buser_name%5D=i+got+it+working+finally"
i can split it on two separate lines
but not on one
im assuming i need to use a regex but am not familiar with regex
21:00
@JoelL Yes, a regex. s.split(/[+=]/)
That means, "split on this set of characters consisting of + and ="
Thank you!
what is a good way to learn learn regex?
god i hate regex
lol
lol
@JoelL the non regex retarded solution:
"post%5Buser_name%5D=i+got+it+working+finally".gsub("+", "-").gsub("=", "-").split("-")
lol dont do that
cool thanks guys
21:06
A good way to learn regex's. I don't know... I just sort of picked them up when I learned Ruby. It wasn't easy at first, but it got easier.
@JoelL Perhaps here: regular-expressions.info
@Nima Haha! Yes, don't do that, or we shall call you unfriendly names.
lol exactly
i would probably come up with that during a "coding interview"
lol
If the string contains any "-" to start, that code will have incorrect results.
yea pretty much
So first, change any "-" to "\0", and then do what you did, and then map all of the words, and for each one, change "\0" back to "-". Easy.
lol
thx wayne for making my awful code look even worse
lol
21:10
s.gsub("-", "\0").gsub("+", "-").gsub("=", "-").split("-").map { |w| w.gsub("\0", "-") }
Any time. Glad to help.
Where's the good place in a Rails project to stick the version.rb file that contains a constant with the project's version?
I guess just drop it in lib?
Lib
yea
at one point everything ends up being in the lib lol
best thing ever
@WayneConrad thanks!
@Nima thanks!
Wayne really answered your question
:)
21:27
You and I did violence to that question, that's what we did.
lol

« first day (431 days earlier)      last day (2824 days later) »