« first day (942 days earlier)      last day (2313 days later) » 

2:20 AM
def is_valid?
%i{name date address email}.all?{|k|!row[k].nil?} && row[:parking]
end
 
Nice use of the (relatively) new %i syntax.
 
not that much shorter, but that valid variable was kinda redundant
 
 
1 hour later…
 
1 hour later…
5:06 AM
@CuddleBunny Hope you are doing well. Please follow the gist link for easier debugging, gist.github.com/anonymous/3048eac9a60ee11832e040e432a94e13
 
6:02 AM
@Vinay [:name, :date, :address, :email, :parking].all?{|k| row[k].present? }
 
6:14 AM
@thegauraw Nice method. But the last one seems to be supposed to be falsy, not non-null
(quadruple negative ftw)
I know, it doesn't make sense, but it's what they wrote
@Vinay maybe even row.values.all? &:present?
 
@JanDvorak I sent you an e-mail, nsfw
 
Just opened it, and I'm interested in your offer. I've recently got unemployed, so even full-time would be fine with me.
 
oh great :D
Not that you're unemployed
But that you're interested...
@copy ^
He will wake up in 8 hours. :P
 
Should I wait until then, or is there someting you'd like to discuss before then?
Anyways - how's it going?
I can see that webAssembly had the chance to go with source code hiding (like in the olden C++ days) but they didn't
 
6:38 AM
@JanDvorak I think you should talk to him or send him an e-mail. I don't know so much about the project.
And it's going great, still doing my masters.
 
6:54 AM
> Demons can't actually fly out your nose, as that would constitute an escape from the sandbox.
 
7:04 AM
@thegauraw that's RoR-only, BTW
Also, not quite equivalent to not nil? - even less so than a falsity test
 
7:41 AM
Thanks @thegauraw @jandvorak
 
 
5 hours later…
12:54 PM
Hope all are doing well. Please follow the gist link for easier debug gist.github.com/anonymous/3048eac9a60ee11832e040e432a94e13
 
yuck
onclick attributes are bad as they force you to place your functions in the global scope
 
So what is the better option then?
 
$("...").on("click", func). You can even define the function inline.
Using bootstrap to center content seems like overkill. <center> is deprecated. For some reason you're using both.
 
Have looked into my code? if yes please do something for getting me the solution as I waited for it for long time. check this link, stackoverflow.com/questions/38322454/…
 
instead of .tr-head td you could have used thead
instead of &nbsp;&nbsp;|&nbsp;&nbsp; use padding and borders (left border except on first element)
or at least padding/margins and a pipe
 
1:06 PM
I just want to change the status that is toggle it from missing to present on my index page.
 
1:20 PM
no solution?
 
1:34 PM
@MuhammadYaseen Since you have been waiting for free solutions and have, unfortunately, not had any, why don't you pay for a solution? There are web sites which you can use to pay someone money to write code or help you solve problems.
 
Or, you know, write it yourself?
 
Or spend the time learning the technology so that you can write it yourself, yes.
 
1:55 PM
Sorry guys, I didn't ask for free solution, I put up my codes in gist for reference in that I got up stuck in the middle that is why I asked for the solution.Never mind if it is so forget it.
 
I didn't quite get where exactly you got stuck
 
@MuhammadYaseen thanks for making a gist, I'll take a look in a little bit
 
2:11 PM
@MuhammadYaseen you around still?
 
@CuddleBunny just let him go... ;-)
 
yeah, figured I'd give it a shot since he went ahead and actually made the gist. Most folks won't even put that much effort into it
 
True...
 
@JanDvorak I am hardworking person, along with my office jobs I have to go through all of these coding through day and night.
 
@MuhammadYaseen I see your problem
<span onclick="changeStatus(this)" calls your function and passes the actual span element, not the event data.
 
2:20 PM
@CuddleBunny You really make me to breath.
 
@MuhammadYaseen why are you doing two jobs?
 
so instead of $(e.target).text(...) you just want $(e).text(...)
 
BTW, this coulf have been solved with a simple debugging - just put a breakpoint where you expect an issue and see where what's happening diverges from your expectations.
 
I think you only get event data passed to the callback if you use .addEventListener(...) or '.on(...)`
^ also that, you should try playing around with the developer tools that come with your browser by pressing f12. There is some awesome stuff in there
except for Safari, the other major browsers all have awesome dev tools
 
@CuddleBunny Thanks for your kind guidance.
 
2:23 PM
even Opera?
 
also look into the things that @JanDvorak mentioned above like not using onclick etc. They aren't necessary to make it work, but it'll increase the quality and maintainability of your code
yeah, opera has dragonfly which is pretty good
 
@JanDvorak Can we chat privately (on google talk or so?)
 
Safari's tools are minimal at best and it is hard to figure out how to do simple things like change styles
 
@CuddleBunny Could you just tell me where can I learn the events in much easier and better ways?
 
@MuhammadYaseen I don't know of any good resources about events
since you're using jQuery, usually you want to add the event later like $('myelement').on('click', func); but since you're using a templated list and adding the handler to more than one similar element, you would need to differentiate them somehow. For that specifically, I would keep doing it the way you're doing right now. Since this isn't a SPA polluting the global scope is only a minor infraction
if you want to pass the event data through onclick the syntax is <span onclick="changeStatus(event)" instead of this
 
3:03 PM
Shopping cart token: not as useful as an actual coin and twice as expensive, yet people buy them anyways.
 
3:28 PM
I've never heard of a shopping cart token.
 
there are very few grocery stores stateside that make you insert a coin to get your shopping cart
Aldi is the only one I've ever been to
 
Here in Czech Republic Czechia they're everywhere.
 
Oh, OK. I've seen such a thing only in airports here in the states. You can rent a luggage cart using coins.
 
most of the shopping cart coin things will give your coin back when you dock the cart
I can only imagine it being worth it in areas where shopping cart theft is rampant, like southern CA
 
Those in the airport do, but I doubt anyone takes advantage of that. Airports are large and most people are happy to give up a dollar (or however much) to let someone else take the cart back.
 
3:35 PM
there were actually people whose job it was to drive around with pickup trucks and retrieve abandoned shopping carts
 
I'm wondering if hauling carts at an airport would be a profitable job
I mean, from the reclaimed coins only, without any extra salary
 
I've never tried to get a cart at the airport and found that there weren't any, so it must be profitable for someone to bring them back.
Oh, you are wondering if there are employees who have that as their job. I don't know.
 
there was a story on NPR about a lady and her kid got stuck at the airport and they made quite a bit of money doing it
can't find the recording, I think it was one of those weekend storytelling shows like moth radio or radiolab
 
I enjoy radiolab.
 
same, a lot of interesting stories I wouldn't normally read but would totally listen to on a road trip
 
3:48 PM
@CuddleBunny Thank you for trying to help Mr. Yaseen.
 
No problem, I get plenty of help so it is only fair. We've all been there
 
 
1 hour later…
4:54 PM
Hello, anyone around? Complete noob to rails here. Got a quick question.
 
Hi corvid, welcome. Ask away.
 
How do we educate users to not wait for our permission to talk?
 
Don't some rooms use a bot to recognize new users and give them some introductory spiel? I don't think we've got a real problem here, this being a low volume room, but that's something we could do if needed.
 
Caprica only works for the JS room, because she's got the room name coded in. I guess you could clone her and run her
I'd say this being a low volume room makes such a bot even more useful because people don't need to wait for us to come back.
 
basically, I am just working on implementing OAuth authentication. I am a bit confused about the process of configuring it with OmniAuth. I have a route for the callback set up in a controller. I am just kinda confused as to how the process goes in Ruby... do you send the email and password from the client to the service, and it hits the callback route?
 
5:07 PM
Maybe so. I wonder if our slowness to respond sometimes isn't in itself valuable feedback: "Oh, this might not be the best place for a quick answer." Because, really, this isn't.
 
@corvid NEVER send a password via email.
except for passwords you don't mind other people seeing
 
@JanDvorak I meant send the email and password via a form or something. I am mostly a bit lost as to the step that initializes the OAuth cycle where it opens the window to the external service. Like when you click login with twitter, it has to bring up the twitter login
 
The idea is that the credentials never touch your server
 
So how do they enter username/email and password? I understand I will get a token back in the callback url that I can use to find the user
 
The authentication authority gives you a URL of the page you are to show to the user
 
5:22 PM
So, I direct them off my site to the sign in page, they sign in, twitter grants a token to the callback url, then I sign the user in and redirect them from my callback url handler?
 
I ... guess so? Usually the login page is presented to the user in a popup window.
 
5:56 PM
> "He" should be read as "he or she" throughout the book. ~~ Andrew S. Tanenbaum
 
@JanDvorak That made me smile.
 
6:26 PM
Is anyone here familiar with rspec or testing in ruby?
 
hello!
ask your question @jake
 
7:23 PM
Hi Jake, welcome. Yes, please ask.
 
7:39 PM
Left us hanging. Classic Jake.
 
7:53 PM
Is the time to create a reusable gem out of something the first time I need to copy-paste it from one app to the next? :P
 
On the first copy, maybe. The second copy usually changes the answer to "Yes."
There are other ways to reuse code, though, that are lighter weight. For example, bundler can use code right out of a git repo.
 
I prefer the git repo route, since it works with bundler and other package managers
and I don't have to remember how to set up packages a million different ways
 
True.
 
oh really now... does the repo just have to be public?
 
No. It just has to be visible to the machine on which you are running Bundler. For example, you can share code using an internal (not public, not on the internet) git server.
 
8:00 PM
Yea, we run an internal BitBucket server. So I'm assuming as long as that URL is opened up that would work. The things I learn by posting rhetorical questions here :D
 
Bundler just needs to be able to git clone it
 
@Jared We try :)
 
8:13 PM
And just worked and now don't have to wait for the build team to make me a new pipeline. Woo :D
Ya'll get a free beer if you're up in my neck of the woods ;)
 
I like beer. I like free. Free beer? Heaven!
 
8:32 PM
sooo. i basically had a long discussion in the elixir chatroom about dependencies .. i mentioned that the missing libraries is preventing people from migrating from rails to phoenix and the immediate response i got was:
you are better of building it from scratch and maintaining stuff yourself..
sooo no official stripe library for elixir? no problem, just build one yourself and maintain it.
no geolocation libraries available? build one yourself from scratch and maintain it
 
Interesting.
 
compared to the rails.. we have gems available for anything
im not sure if that argument made sense to me..
 
I wonder if that attitude is a reaction to the prevalence of magic in Rails libs.
Rails has a lib for everything, but the way Rails libs work is usually just magic.
 
i agree to certain extend that too much dependencies is* insanity .. but also there is a fine line ..
quote from the room:
[..]
Also when it comes to API wrappers, I found that are often not needed - especially when working with a good REST API

[1:49]
Especially when you use one or two endpoints

[1:50]
Why pull in a giant lib that defines 30 or 40 and pull sin other deps?

[1:50]
I recently switched ex_twilio in our app for straight call to send the sms with API. Removed 3 or 4 deps in total and added just 10 LoC
[..]
 
8:49 PM
sometimes that is fine, but some libraries are huge and would take a lot of work to mainain
Stripe has simple APIs though, even though there was a Ruby library I just used REST there as well
 
right
i wanted build an application that involved GeoLocation stuff for parts of it.. in rails there was the
geocoder gem which basically took care of everything
in elixir, there was 1 library with only 1 maintainer..
lol soo sticking to rails for now..
 
adopting new frameworks is easy enough since you can plug in other things to fill the holes, but new languages is hard.
 
right
 

« first day (942 days earlier)      last day (2313 days later) »