Activity Graph

Page 1 of 8 | Next »


[03:29:22] mehwork: has left #RubyOnRails: ()


[16:02:46] mehwork: has joined #RubyOnRails
[16:05:41] mehwork: What do you guys do when it comes to create database migration files for postgres: 1) Create a single file just for "CREATE SCHEMA" statements or 2) put your CREATE SCHEMA statements in the same files as your CREATE TABLE migrations?
[16:06:18] mehwork: google found this article but it shows both ways but doesn't say which is better
[16:06:50] mehwork: I was thinking that having CREATE SCHEMA only once makes more sense from both a DRY perspective and to make sure the command isn't ran once for every create table
[16:32:08] mehwork: part of me thinks it shouldn't be in any migration file, since doing 'drop schema foo' could be quite dangerous


[22:41:58] mehwork: has left #RubyOnRails: ()


[03:30:34] mehwork: has joined #RubyOnRails
[03:54:18] mehwork: how do you disable color output with bundle exec cap production deploy? I tried adding --no-color after bundle exec but it didn't work


[16:15:33] mehwork: Quit: leaving


[22:46:33] mehwork: has joined #RubyOnRails
[22:47:15] mehwork: does rails have an easy builtin way of seeing the sql query active record is generating for the current page?
[22:48:01] mehwork: i was hoping for something more specific than the logs, what is *.to_sql?


[00:02:27] mehwork: has left #RubyonRails-offtopic: ()


[14:45:11] mehwork: Ping timeout: 250 seconds
[14:51:55] mehwork: has joined #RubyonRails-offtopic


[12:30:34] mehwork: has left #ruby: ()
[12:30:37] mehwork: has left #RubyOnRails: ()


[13:17:29] mehwork: shouldn't doing ar = [1,2,3,4,5,6].map { |i| if i.even? "#{i} is even" else next end } p ar not show nil's?
[13:18:53] mehwork: jhass is there another way of doing what i want then? Also it doesn't seem to be exiting, break does though
[13:24:19] mehwork: jhass i still don't get it. Everything i'm reading says that next in a block should act like 'continue' and 'exit the block immediately, returning control to the iterator method, which begins a new iteration by invoking the block again'
[13:25:06] mehwork: so i don't understand why in my example, i couldn't use 'else next' to skip it from returning nil
[13:26:27] mehwork: are there blocks that aren't loops?
[13:28:54] mehwork: jhass: so there's no way to do what i want to do?
[13:29:59] mehwork: alright thanks
[13:32:36] mehwork: jhass: this worked ar = { |i| i.even? }.map { |i| "#{i} is even" }
[13:35:10] mehwork: jhass: is the select any faster than just compact'ing after the fact? ( i guess it depends on how large the array grows )


[16:11:44] mehwork: how come this prints :foo instead of 'B': def foo(a: 'A', b: 'B') p b end
[16:12:07] mehwork: I know i should just be doing foo(whatever) and passing the dict in during call time, but still curious
[16:22:24] mehwork: workmad3: woops, you're right. I thought i called it in the repl, but hadn't


[14:10:01] mehwork: how come 0..3.to_array doesn't work unless you add parens? I thought parens were option in ruby?
[14:10:18] mehwork: .to_a that is


[00:13:32] mehwork: has joined #RubyonRails-offtopic
[00:13:38] mehwork: has joined #ruby
[00:13:46] mehwork: has joined #RubyOnRails


[03:10:07] mehwork: i'm trying to use 'pry-rails' in a project that doesn't specify it in Gemfile. So i just 'gem install pry-rails' to my dev's ruby, but when i type 'rails console' it's still using irb, not pry. Any idea why?
[03:11:09] mehwork: Radar: i don't want to accidently commit it


[17:49:00] mehwork: i'm really confused about when to use 'and' vs '&&' and this is making it more confusing
[17:49:27] mehwork: they seem to be doing the same things in ruby 2.2.3 for me
[17:51:29] mehwork: hmm puts 3 and 5 and 7 and false and 9 says 3 and puts 3 && 5 && 7 && false && 9 says false
[17:52:52] mehwork: shouldn't what i did print 7 or false if it's short circuiting once it reaches something false
[17:53:49] mehwork: oh it's parens, this says false: puts (3 and 5 and 7 and false and 9)
[17:54:03] mehwork: alright thanks
[18:22:46] mehwork: speaking of rbenv, is there a way to make it rehash automatically somehow? I hate having to type 'rbenv rehash' every time i install any command
[18:23:25] mehwork: i just switched to rbenv from rvm
[18:23:47] mehwork: how do i know switching to chruby won't require switchign to somehing else in a week :p
[18:24:45] mehwork: all i hear is 100 lines of hell
[18:25:02] mehwork: i use zsh, will that matter?
[18:25:20] mehwork: i guess i'll try it after i upgrade to el capitan
[22:51:47] mehwork: this is weird 'rails g controller Comments' says it created 'app/views/comments' (which it did) but git status never mentions app/views/comments even after i did 'git add .'
[22:52:03] mehwork: oh nm, it's that annoying thing git does where it doesn't add empty dirs. It shows up if i add a file to it
[22:54:08] mehwork: gerep: no but i figured out why
[22:59:43] mehwork: gerep: rails didn't add a .keep though. I'm using 4.2 and it didn't add a .keep to views/comments when i ran 'rails g controller comments'


[00:00:17] mehwork: whereas php is popular because it's easy to find people who know it and is crappy
[00:02:39] mehwork: ror is a framework
[00:02:53] mehwork: ruby beibg the language
[00:03:48] mehwork: Thomas-0725: i dont think it gives an advantage other than maybe working with smarter people than some
[00:05:34] mehwork: you won't know the answer until you learn more than one
[00:06:04] mehwork: it'd be like only test driving one car
[00:07:05] mehwork: skip math and regex
[00:07:31] mehwork: until needed
[00:08:51] mehwork: Thomas-0725: rails 4 in action
[00:09:11] mehwork: that's a good book that you dont have to read
[00:09:21] mehwork: if you're just trying to get a job as a web dev
[00:09:49] mehwork: it's a far different world from comp sci unless you're landing a very specific comp sci requiring job
[00:10:24] mehwork: you will overload your brain with so much stuff that you won't use, is all i'm saying. I'd start with what you will use: ruby and rails
[00:10:47] mehwork: then spend some time learning javasript/css before regex
[00:11:06] mehwork: ok if that's your goal then start learning some algorithsm now then actually
[00:12:12] mehwork: it's hard to give career advice. If you're going into AI consider looking at python
[00:12:23] mehwork: with python there's tons of AI, machine learning, etc jobs that don't require web to get your foot in the door
[00:13:04] mehwork: rails is more for people who want to do the web and do it right
[00:13:29] mehwork: Thomas-0725: most tech jobs require a degree or actually knowing how to do it
[00:13:35] mehwork: if you can prove you can do it, someone will hire you
[00:13:50] mehwork: but you will have less choices probably
[00:15:28] mehwork: whenever a new programmer says they want to do something harder, like AI, game programming, kernel hacking or whatever, asking for advice in a web dev channel isn't the best idea
[00:15:44] mehwork: since that tends to be above our heads, we're like the ben affleck of the movie
[00:15:49] mehwork: you need to talk to some will's
[00:18:41] mehwork: i'm self-taught but my teacher lets me goof off too much
[00:19:21] mehwork: i've never paid to learn anything programming wise and have made probably millions of dollars writing CRUD apps. but that is far from AI
[00:19:49] mehwork: no one in their right neuro network would pay me to do AI
[00:21:14] mehwork: i'd like to say that if you're smart enough to learn AI, you're smart enough to learn a web framework, but that might not be true. Being able to get a web dev job usually means being a jack of all trades, very practice and fast and experienced. Not able to look everything up in a text book or apply one math solution
[00:21:47] mehwork: my point being, that if you're trying to break into AI by first breaking into web dev, you might be totally distracting yourself
[00:22:22] mehwork: i'd say avoid web, go python and go get one of the thousands of python jobs out there i see all of the time that don't require web dev
[00:22:51] mehwork: it's harder to find pure ruby jobs that don't also want rails though, i think is what he's worried about
[00:23:41] mehwork: i'm not opposed to it. I don't know anything about it and have been more than busy with web stuff
[00:26:11] mehwork: Thomas-0725: it will be hard to get anyone to hire you without either a degree or some general programming work experience i'm sure. So maybe it doesn't matter if you get into rails. Just get some jr to intermediate web dev jobs if that's what it takes and focus on your AI
[00:26:24] mehwork: and let nature take its course. You might find you end up wanting to focus on web
[00:27:06] mehwork: at the very least it will look better if you have some tech companies on your resume rather than mcdonalds
[00:27:29] mehwork: Thomas-0725: OR keep your day job and just do a lot of open source stuff in AI
[00:28:29] mehwork: the only shame in fast food is those who eat it
[00:44:05] mehwork: maybe you're stuck on the problem because you haven't slept
[00:45:26] mehwork: i'm not a doctor but i play one on irc
[00:48:40] mehwork: computers will always let the programmer know they're the one really in charge
[01:33:05] mehwork: did rails 4 change flash messages css from #alert to .error?
[01:33:34] mehwork: oh i think it's just another tutorial saying diff things
[15:27:34] mehwork: has joined #ruby
[15:28:32] mehwork: i wish this had been kept up to date, it's 404'ing a lot
[15:34:23] mehwork: the cheat gem lets you add new cheat sheets if you happen to know the name and do 'cheat <whatever>' but you can get a list without 404ing when you do 'cheat sheets' and the wiki itself is 404'ing to list them all. So it's only half broken at least
[15:49:40] mehwork: in rails tutorials i see people using blocks with do/end instead of braces: <% @articles.each do |article| %> ... <% end %> but my ruby book says its always better to use braces: <% @articles.each { |article| %> ... <% } >
[15:49:46] mehwork: is that true?
[15:52:03] mehwork: maybe it only matters in ruby code, not erb?
[16:30:38] mehwork: waseem_: ok, im reading that it's more idiomatic to use braces because it's less characters and has a higher precedence but i guess in this case it doesn't matter. THanks
[16:31:42] mehwork: i wonder why ruby didn't use enddef, endif enddo, etc instead of just having a bunch of end's at the bottom of things
[16:31:55] mehwork: i guess that is ugly
[16:35:18] mehwork: yeah but i mean } or end often requires a comment saying what it's ending
[16:35:37] mehwork: or an editor that's smart enough to know
[16:36:46] mehwork: proper indentation is good enough for me most of the time


[18:53:53] mehwork: i'm trying to figure out why 'params' is a global variable in my controller automatically. I think it's because of action_controller/metal/params_wrapper.rb's 'inherited' method doing `params = klass._wrapper_options.dup`. Does that seem right?
[18:54:13] mehwork: i'm still learning ruby so am just guessing
[19:02:28] mehwork: FailBit: thanks
[20:34:34] mehwork: i'm confused about something: ActiveRecord says all database handling is done from the model, but isn't this in my Controller's 'show' action accessing the db: @article = Article.find(params[:id]) ?
[20:36:49] mehwork: slash_nick: ok, i get it thanks
[20:37:09] mehwork: i was forgetting the point of controllers as far as how they relate to models for a second
[20:39:34] mehwork: isn't enterprise stuff's only advantage that you pay for tech support? Which is rarely an advantage if you hired your own engineers?
[20:40:38] mehwork: what's a rolling restart?
[20:42:34] mehwork: i see, but you can do that without that feature i imagine (haven't deployed rails yet) but that would be nice if it was automatic
[20:43:19] mehwork: tubbo: probably, i'm just picturing basic load balancing
[21:04:11] mehwork: it's ok, a lot of programmers don't have a programming background. It's kind of like how many drivers on the road don't know the rules of the road
[21:04:32] mehwork: which is evident every time i come to a stop sign
[21:04:44] mehwork: and they wave me on to go but it's their turn
[21:05:23] mehwork: doesn't make it right, but we live in a chaotic time
[21:05:53] mehwork: safety shouldn't have to be a #1 important priority in a car, it should be the number one important thing in a driver
[21:05:56] mehwork: but i digress
[21:11:46] mehwork: FailBit: why a hobby? what do you do
[21:12:30] mehwork: sounds less stressful
[21:13:08] mehwork: even though i can program i'd often rather not for a living, making it so there's even more demand because who wants to be a code monkey trying to do the work of ~5 engineers because they can find/afford that many
[21:13:44] mehwork: and the bs apps and weird priorities are getting old but i don't have a degree so i can't make as good of a living doing much else
[21:13:56] mehwork: teach me the ways of plugging i cables
[21:14:27] mehwork: i was too, but 10 years later you'll be like 'wth is wrong with this stupid industry'
[21:15:49] mehwork: the "10x" engineers do 10 times the work for roughly the same salary. Most of what you learn won't be applicable and you'll be spending more time fixing other peoples stupid bugs than writing new code
[21:15:53] mehwork: but other than that it's great
[21:16:49] mehwork: no one ever says "a wise woman once said", maybe they're wiser. Let's here from them for a change. just saying
[21:17:07] mehwork: because my wife would rather me make less money and have more time for her
[21:17:51] mehwork: "sorry honey, my work wants me to stay late to fix production because no one bothered to test properly"
[21:18:20] mehwork: i think how much money you make is only important if it's proportionate to not working over time
[21:18:48] mehwork: if it's a 9-5 and you make 6 figures great, but if it's 40+ hours then the salary should double for every 10 extra hours you work. But that's not what happens :p
[21:19:16] mehwork: you will get a 1% raise after a year of working 10-30 hours extra per week. So wrong.
[21:20:13] mehwork: there should be almost nothing stressful about programming other than when production goes down or you're being hacked and both of those are ops issues
[21:20:39] mehwork: but somehow "they" have created an imaginary sense of pressure and panic
[21:21:47] mehwork: looking back on the past 10 years, what actually mattered? very little if anything heh
[21:22:02] mehwork: startups are the worst. I can't even.
[21:22:27] mehwork: it's no wonder startups have to give free booze
[21:23:01] mehwork: we don't have HR but we have beer. What could go wrong.
[21:23:41] mehwork: you don't need a 401k, just equity that seems worth more now. None of that real money that's too longsighted.
[21:24:11] mehwork: i don't like overly large companies either. I have just as many jokes for them
[21:24:27] mehwork: i don't mind the ones with a startup feel though
[21:24:42] mehwork: meaning you can get stuff done but have stability
[21:25:17] mehwork: i'm thinking of going into freelancing just so i can be the boss for once
[21:25:32] mehwork: but i don't think my wife will be happy about the potentially longer hours
[21:25:56] mehwork: yeah but i'd look at it as firing my client rather than quitting
[21:26:38] mehwork: they're bosses but like in a video game
[21:27:10] mehwork: tubbo: yeah i'd worry about that
[21:27:27] mehwork: money is the real issue. Why aren't we all just hippies again?
[21:29:27] mehwork: i used to make websites like that and they actually paid me the big bucks, literally hundred of dollars
[21:30:05] mehwork: to be fair, the shopping cart crap i made for them didn't make them much money either
[21:31:13] mehwork: mysql or apache process went down along with their entire business since there was no one left to restart it and they probably felt jipped for it not being sustainable
[21:32:21] mehwork: neohunter: it's great to know that there are people like you out there actually looking into why their website is displaying 'something went wrong'. I often wonder
[21:34:42] mehwork: tubbo: i have a theory that if as a freelancer i was happy with say 50k a year, which is decent money really, i'd not have to take any/many crappy clients. It's only if i feel i have to make 100k+/yr that i take any job i hate
[21:35:44] mehwork: most of us probably budget for what we are currently making, so things always still manage to seem tight.
[21:39:33] mehwork: tubbo: sure, but if the alternative is to be an overstressed/overworked person for the sake of stability, it's not much of a win
[21:39:43] mehwork: let's be hippies
[21:40:00] mehwork: my hair looks kind of cool long
[21:40:27] mehwork: yeah but you know how to unplug the matrix
[21:41:05] mehwork: Chief TakingTheBlame Officer
[21:42:10] mehwork: my dad worked for the same company his entire adult life until he retired. The longest i've worked anywhere is 3 years. I have a 'has_many' relationshp to jobs
[21:42:29] mehwork: instead of freelance i'm slavelance
[21:42:48] mehwork: first world problems
[21:43:20] mehwork: sometimes i want their to be a zombie apolocypse just so i can get some fresh air and run around outside a bit
[21:43:45] mehwork: i could be doing it right now but i have to irc
[21:44:05] mehwork: so that i appear to be busy working at my desk
[21:46:30] mehwork: if they're going to pretend to pay me the big bucks, the least i can do is pretend to work
[21:47:20] mehwork: kind of like how people at gym's pretend to workout so they can pretend the monthly fee is worth it
[21:49:04] mehwork: planet fitness wouldn't be a misnomer if the planet we were on was zero-gravity
[21:50:55] mehwork: what better way to get people to the gym than to have pizza and cookies waiting for them. Dentists should be so clever.
[21:51:14] mehwork: they used to be, didn't they used to give out lollipops
[21:51:33] mehwork: now i get why startups have free beer. It's all so clear now
[21:52:10] mehwork: pwnd_nsfw: which? i'd join
[21:54:13] mehwork: just make sure you have the mysql gem and then create your models
[21:55:30] mehwork: pwnd_nsfw: do you know what its' called? Not seeing it in the topic
[21:55:54] mehwork: bonus points if it's called something like #offtherails
[21:56:25] mehwork: i just joined there and there's only one person there: wycats. So maybe that is it?
[21:58:37] mehwork: has joined #RubyonRails-offtopic
[22:02:48] mehwork: i've heard such great reasons for using mongo as: because i like javascript and because i like json
[22:04:10] mehwork: and they do have a fair argument against postgres: because it's harder to setup. Getting dressed is also harder than just walking all day without pants so mongo is the "i don't want to put on pants" of the database world
[22:05:39] mehwork: jacobsmith: are sure it's not just too many dom objects that are poorly managed?
[22:06:13] mehwork: jacobsmith: iow did you run a browser profiler on the page itself yet
[22:07:43] mehwork: jacobsmith: google's page speed test maybe. Chrome's is usually fine
[22:08:38] mehwork: jacobsmith: for tables maybe check out
[22:09:39] mehwork: i'm going to go consume a large amount of cheese and i'll be back
[22:18:39] mehwork: if you think you need or you think you don't, either way, you're right
[22:19:10] mehwork: well, you're probably wrong, but that doesn't sound as good
[22:51:19] mehwork: is it ok to add javascript to an erb layout, or should the layout always just javascript_include_tag a .js file?
[22:52:06] mehwork: assets folder
[22:52:16] mehwork: i just want to add some simple js to a flash message
[22:52:45] mehwork: yeah inline unless that's never a good practice
[22:53:45] mehwork: googling this is turning up 5 year old links mostly
[22:54:21] mehwork: is it <%= javascript_tag do %> or <script> ?
[22:55:35] mehwork: i'm not some fancy html engineer
[22:55:43] mehwork: jk i get what you're saying. Thanks it makes sense now
[22:56:26] mehwork: full-stack html engineer. I open AND close my own tags, thank you
[22:56:58] mehwork: and even write the content in between the tags
[22:57:23] mehwork: you sound more like an htmlOp then
[22:57:57] mehwork: then you're more of a data engineer
[22:58:20] mehwork: sr hobbyist sounds better
[22:59:20] mehwork: titles are important, that's why i'm Director of IRC Goofing
[23:00:01] mehwork: i have learned more in here than in my tutorials at least
[23:00:41] mehwork: and it's more fun than reputationoverflow
[23:00:55] mehwork: they're mostly just missing a lot of things
[23:01:13] mehwork: but don't say "we'll leave that as an exercise for the reader", it's just implicit
[23:02:20] mehwork: i think it's just hard to write tutorials, there's so many steps that are easy to skip if you already know what you're doing
[23:02:52] mehwork: it's like a kungfu teacher trying to teach you how to punch, forgetting to show you how to make a fist first
[23:03:32] mehwork: noobs are good at finding basic mistakes because we dwell in the basics
[23:03:48] mehwork: it's like when a kid asks you a questio and stumps you
[23:05:08] mehwork: growth lead
[23:06:16] mehwork: now you have 2 problems?
[23:09:39] mehwork: i have no idea what's going on but my spidey sense (bug sensor) is going off pretty loud
[23:11:04] mehwork: is overriding and monkey patching the same thing in ruby?
[23:11:15] mehwork: maybe you're not quite wrong then
[23:12:03] mehwork: monkey patching usually means dynamic overriding iirc
[23:13:37] mehwork: neohunter: maybe
[23:20:31] mehwork: sounds like
[23:21:27] mehwork: that sounsd right
[23:22:01] mehwork: it sounds like you want a log yeah
[23:22:49] mehwork: you want a debug flag that freezes an error on the web page itself then if you access it from inside your vpn essentially?
[23:23:35] mehwork: you want to whitelist some ip's act as if you were running in a dev environ?
[23:29:05] mehwork: neohunter: did you do
[23:30:40] mehwork: "By default, it returns false, but someone may set it to `request.local?` so local requests in production still shows the detailed exception pages"
[23:31:20] mehwork: iow, you don't have to override the other method afaict, you just need to toggle it with ?
[23:31:30] mehwork: but i could be wrong, i'm noober than noob
[23:32:17] mehwork: if i was any more of a noob i wouldn't exist
[23:35:19] mehwork: probalby that or something in the config not loading
[23:38:43] mehwork: did you see
[23:39:43] mehwork: or