Activity Graph

Page 1 of 41 | Next »


[18:03:19] AntelopeSalad: monads are simple!


[23:34:37] AntelopeSalad: gsd, i don't know about heroku but the whenever gem is good for cron jobs in ruby
[23:35:28] AntelopeSalad: no, it's a ruby dsl that spits out a real cron script
[23:35:58] AntelopeSalad:
[23:36:04] AntelopeSalad: but i don't know if it'll work with heroku
[23:37:37] AntelopeSalad: at least the scheduler isn't $100/month
[23:38:01] AntelopeSalad: i was expecting to load the add on page for it and see like $49/month - allows a maximum of 3 cron jobs per week


[19:11:10] AntelopeSalad: tubbo, have you used ninefold?
[19:11:26] AntelopeSalad: their free tier looks impressive, 1.5 gigs of ram is a lot for nothing
[19:12:54] AntelopeSalad: tubbo, i'm guessing you've seen this?
[19:14:22] AntelopeSalad: hah, that's a pretty big burn
[19:17:15] AntelopeSalad: ninefold seems expensive outside of the free tier
[19:17:27] AntelopeSalad: expensive relative to DO at least
[19:17:39] AntelopeSalad: tubbo, yeah for sure
[19:18:07] AntelopeSalad: i once priced out a pretty standard production setup on heroku, it was like $300/month for just normal stuff you'd expect like centralized logging, ES, etc.
[19:18:15] AntelopeSalad: that was only with 1 worker too lol
[19:19:16] AntelopeSalad: bratsche, i just use postres' backup package
[19:21:10] AntelopeSalad: bratsche, the autobackup script is good at backing things up locally
[19:21:34] AntelopeSalad: then it's up to you to figure out where to store them -- could be another host, email (if it's small), somewhere on aws, etc.
[19:22:23] AntelopeSalad: bratsche, take a peek at
[19:22:27] AntelopeSalad: there's one for mysql too
[19:23:42] AntelopeSalad: i recommend using the jessie version tho (1.0.5), it supports global objects and optional encryption
[19:25:08] AntelopeSalad: workmad3, you know what's fun, rolling your own local apt cache server and storing your ruby builds there
[19:25:17] AntelopeSalad: 10 second ruby installs $
[19:26:11] AntelopeSalad: tubbo, it was definitely anti-fun
[19:26:16] AntelopeSalad: but it's fun to use it
[19:27:17] AntelopeSalad: workmad3, speaking of deploying... have you experimented with deploying pre-gem installed versioned zips?
[19:27:41] AntelopeSalad: i noticed a typical app with all the gems pre-bundled could easily be 100mb, it didn't seem reasonable to send that every push -- maybe rsync?
[19:28:21] AntelopeSalad: gitlab's style of deployment seems pretty good
[19:28:28] AntelopeSalad: have you guys seen their setup?


[21:09:41] AntelopeSalad: speaking puma... does anyone know how to get it to write to syslog instead of a file?
[21:10:40] AntelopeSalad: tubbo, are you running nginx 1.6 or 1.7?
[21:12:20] AntelopeSalad: oh, i've been running 1.6.x for a while but i never tried AC::Live
[21:12:57] AntelopeSalad: tubbo, i am using a similar gem and i had no prob getting rails to write to syslog, but i dunno how to get puma/unicorn to
[21:13:23] AntelopeSalad: puma has stdout_redirect , but it only takes a file i think
[21:14:47] AntelopeSalad: stdout_redirect 'my/log/file/cool.log' &> /var/log/user.log?
[21:15:56] AntelopeSalad: tubbo, hmm... so this won't be messing with syslog's internals or anything?
[21:16:07] AntelopeSalad: if i write directly to daemon.log or user.log syslog doesn't care?
[21:16:17] AntelopeSalad: as long as it ends up in the file it's happy?
[21:16:34] AntelopeSalad: btw unicorn has stdout_path and stderr_path too , which accept a file path
[21:17:03] AntelopeSalad: i never investigated syslog heavily, i just use it casually because having to logrotate 10 different services sucks
[21:17:21] AntelopeSalad: awesome tip tho, that should work fine
[21:18:37] AntelopeSalad: tubbo, i am using rsyslog but i don't use the remote capabilities of it
[21:18:40] AntelopeSalad: it just happens to come stock with debian
[21:19:47] AntelopeSalad: but man... with your cute little trick of writing directly to the file
[21:19:56] AntelopeSalad: that means we can setup nginx to write there too
[21:20:19] AntelopeSalad: because AFAIK only nginx 1.7.1+ (or 1.5.x commercial) officially supports syslog in its access_log/error_log
[21:43:48] AntelopeSalad: tubbo, how do you guys combat the triple request log of death?
[21:44:13] AntelopeSalad: rails, your web server and nginx all log typical request info (status code, end point, timestamp, etc.)


[15:56:35] AntelopeSalad: does anyone know how to use a custom log formatter with ?


[18:12:32] AntelopeSalad: incoming stupid question, is it 100% guaranteed that if you change a non-comment line in any /config file then you must restart your server in production mode? (i know the routes file is safe in dev)


[14:25:59] AntelopeSalad: mikecmpbll, something like this? SOME_TYPE.safe_constantize.reflect_on_association(:YOUR_POLYMORPHIC_TABLE).klass == self
[17:01:12] AntelopeSalad: has anyone noticed sending a USR2 to puma in preload mode causes it to shut down and never come back?
[17:06:36] AntelopeSalad: hey workmad3, have you ever used puma in preload mode?
[17:07:22] AntelopeSalad: workmad3, yeah i'm not doing phased restarts anymore
[17:07:33] AntelopeSalad: i just noticed this in their docs -- they say to send a USR2 (which i did but), but...
[17:07:34] AntelopeSalad: If the new process is unable to load, it will simply exit. You should therefore run Puma under a supervisor when using it in production.
[17:07:44] AntelopeSalad: guess like you need active monitoring to use it
[17:08:10] AntelopeSalad: i don't understand the point tho, if it totally dies, why not just stop+start it
[17:09:03] AntelopeSalad: workmad3, yeah i know but they are saying to USR2 it to restart it
[17:09:11] AntelopeSalad: but it sounds like their version of a restart is nothing more than fully killing it
[17:09:28] AntelopeSalad: i thought usr1 was
[17:09:51] AntelopeSalad: all i know is when i send usr1 or usr2 with preload_app! , it ends up where puma is no longer running at all
[17:10:46] AntelopeSalad: my new thought process is phased restarts are flawed with puma
[17:11:17] AntelopeSalad: if you want no downtime then just do a proper rolling restart, else deal with a few seconds of downtime because it probably doesn't matter
[17:11:51] AntelopeSalad: yeah but to really benefit from it requires a lot of extra hassle during releases
[17:12:05] AntelopeSalad: compared to just always restarting and dealing with a tiny bit of downtime
[17:14:03] AntelopeSalad:
[17:14:15] AntelopeSalad: even this code hints that a USR2 should restart in any mode
[20:18:26] AntelopeSalad: yeah i would just use ruby-install if you only need 1 version
[20:19:35] AntelopeSalad: rbenv is ridiculous in that sense
[20:22:43] AntelopeSalad: shevy, you should try building an apt package to install ruby 2.1


[00:00:11] AntelopeSalad: just go with 2.1.2
[19:15:52] AntelopeSalad: is the "server" object something unicorn gives you access to in its config?
[19:17:27] AntelopeSalad: if so, what's the difference between these 2 lines?
[19:17:39] AntelopeSalad: it's accessing the pid in 2 different ways hmm
[19:18:38] AntelopeSalad: hah wow i somehow missed that
[19:18:44] AntelopeSalad: lack of syntax highlighting!
[19:18:54] AntelopeSalad: sure but look at 91-92
[19:19:07] AntelopeSalad: server.config[:pid] and
[19:19:19] AntelopeSalad: is def. going to be the active pid -- but does unicorn write out that .oldbin file by default?
[19:20:45] AntelopeSalad: i'm guessing it's something unicorn manages internally
[19:21:08] AntelopeSalad: there's no other reference to ".oldbin" in the entire gitlab repo
[19:21:29] AntelopeSalad: btw gitlab is awesome if anyone cares :D
[19:22:07] AntelopeSalad: tubbo, yeah installing it is no joke but once it's up and running it's fantastic
[19:22:33] AntelopeSalad: are you using the ci aspect of it too tubbo?
[19:23:03] AntelopeSalad:
[19:23:50] AntelopeSalad: ah, that seems good
[19:24:14] AntelopeSalad: the backup part is nice, i feel way more safe with code being in 3 spots instead of 1 or 2
[19:26:04] AntelopeSalad: i'm a lone wolf
[19:27:00] AntelopeSalad: i didn't look too hard but i'm 73% sure gitlab had a way to import a repo from github
[19:27:44] AntelopeSalad: you could also setup a post receive hook on github to push to gitlab maybe
[19:28:20] AntelopeSalad: 1 line of code!
[19:31:17] AntelopeSalad: btw tubbo, i found a really good way to install gitlab


[13:21:01] AntelopeSalad: is anyone familiar with the backup gem?
[13:21:13] AntelopeSalad: it accepts a host option but it doesn't seem to actually connect to that host
[13:21:22] AntelopeSalad: it always goes for localhost
[13:22:19] AntelopeSalad: pontiki, i have an app server and a db server , i had the backup script on my app server
[13:22:45] AntelopeSalad: even with a remote host specified it tries to execute: sudo -n -u postgres pg_dump
[13:23:25] AntelopeSalad: so it completely ignores the -h option
[13:24:10] AntelopeSalad: i guess it's time to stop using that gem :D


[14:57:09] AntelopeSalad: can you just append ?timeout=10000&pool=5&encoding=unicode , etc. to a DATABASE_URL?


[19:37:48] AntelopeSalad: iszak, rubocop
[19:41:34] AntelopeSalad: that seems really large but not impossible i guess
[19:45:49] AntelopeSalad: shevy, are you using du -h to figure out the size?
[19:46:11] AntelopeSalad: if it includes git repos then it might be small
[19:46:46] AntelopeSalad: that includes everything
[19:47:02] AntelopeSalad: maybe look up a little for the lib folder?
[19:47:48] AntelopeSalad: i don't know, i never used it but text compresses really well
[19:49:12] AntelopeSalad: my largest non-rails gem is only 600k for the lib folder
[19:50:33] AntelopeSalad: try zipping it, i bet it gets that compression or better
[19:53:38] AntelopeSalad: damn you peek, why don't you show in depth query information like rack mini profiler
[21:35:49] AntelopeSalad: for the guys deploying rails apps without git directly (ie. pre-compiled --deployment self contained folders), do you just use rsync?
[21:36:48] AntelopeSalad: wasamasa, are you building a command line app?
[21:37:11] AntelopeSalad: , and never look back
[21:38:33] AntelopeSalad: up to you, i've built many apps and my thor class usually never goes above 40-50 lines
[21:39:21] AntelopeSalad: not that i've seen, argparse is quite good
[21:41:21] AntelopeSalad: wasamasa, btw, you can make subcommand-less thor commands
[21:41:31] AntelopeSalad: i assume you mean like being able to do: myapp --foo bar?
[21:42:30] AntelopeSalad: map %(-v --version) => :version , where version is just some method with no arguments (but arguments could be passed if you want)
[21:43:26] AntelopeSalad: also i forgot the %w there, oops
[21:46:18] AntelopeSalad: that dsl is making me ill to my stomach
[21:47:48] AntelopeSalad: it's true, people who eat a lot of salad tend to have iron stomachs
[21:48:32] AntelopeSalad: 1. not using that one x 3
[21:49:52] AntelopeSalad: my "do i like it" criteria is usually how often i have to refer back to the docs when using it
[21:50:15] AntelopeSalad: if it reads naturally and isn't complex it lends itself to easily be remembered
[21:56:56] AntelopeSalad: that one looks a lot better
[21:57:20] AntelopeSalad: but at that point it just looks like a more verbose thor
[21:58:10] AntelopeSalad: you don't need to hack anything tho, you just make a method and map some flags to it
[22:41:17] AntelopeSalad: robscormack, is it better than frontpage?
[22:43:53] AntelopeSalad: benzrf, but with code i can't create sites like this in 2 minutes
[22:47:57] AntelopeSalad: benzrf, you get to see it in all its glory as you design it with a WYSIWYG editor


[11:14:03] AntelopeSalad: if i gem install with --deployment, is it safe to just copy that dir over to a different machine and have it all work as long as the OS/architecture is the same?
[11:14:14] AntelopeSalad: i'm not sure how the compiled gems are handled in that sense
[11:14:28] AntelopeSalad: *bundle install


[19:50:01] AntelopeSalad: does anyone know how to reach into a thor class and get the available options for a command?
[19:50:07] AntelopeSalad: (from outside of the thor class)
[19:54:38] AntelopeSalad: i spent a while looking at the source/docs, i couldn't find a way
[19:59:51] AntelopeSalad: nope, i couldn't initialize my class , it kept throwing errors
[20:00:12] AntelopeSalad: but when i fulfilled what it said it expected then it still failed


[13:15:38] AntelopeSalad: is there some magical command i can run that lets me rake db:create on the server supplied in my database.yml?
[13:15:59] AntelopeSalad: i'm working inside of a linux container and so it's not localhost
[13:16:08] AntelopeSalad: mikecmpbll, please share
[13:16:57] AntelopeSalad: mikecmpbll, yeah but i want the db to be created on the -remote- server, not localhost
[13:17:15] AntelopeSalad: db:create is a local command, i figured maybe there was a way to make it work for remote hosts
[13:17:34] AntelopeSalad: the host is set correctly, it's a limitation of the create task


[22:53:25] AntelopeSalad: how would you split up a string that's already inside of a heredoc?
[22:53:54] AntelopeSalad: rubocop is ripping my face off when it comes to line length and most of my issues are due to having heredocs that have somewhat long lines


[11:43:17] AntelopeSalad: aZtec_: are the people editing the site designers and are capable of making good layout decisions?
[11:44:54] AntelopeSalad: "designers" as in, doesn't know anything about html/design but think they have "the eye" and that "websites are easy"?
[11:46:06] AntelopeSalad: when i get clients who ask for features like that i tend to ask them if they have intentions of changing the content on a regular basis
[11:46:51] AntelopeSalad: they usually say no and in the times when they do, we scope it down to them wanting to edit a specific part of the page and then i extract that to a model and make it easy for them to edit without having to worry about any coding
[11:48:51] AntelopeSalad: you could probably google around for "rails cms" and find something too
[11:48:59] AntelopeSalad: haven't used any personally
[11:49:29] AntelopeSalad: but if you have a full blown invoicing thing setup, i'm not sure how viable that's going to be
[11:51:02] AntelopeSalad: making a good content editing platform isn't easy
[11:51:28] AntelopeSalad: you could probably find some reasonable middleground tho, maybe a markdown approach?
[11:52:19] AntelopeSalad: aZtec_: what's your opinion on stackoverflow's markdown editor?
[11:53:30] AntelopeSalad: you could have those static pages be written in markdown and then let them edit that
[11:53:56] AntelopeSalad: now your non-coder/"designers" have something they can fool around with, without requiring you to build some half baked wysiwyg general editor
[11:56:27] AntelopeSalad: you could just have a single Static model i guess and give it a field to distinguish which page it's for
[11:58:29] AntelopeSalad: that begins to sound like more structured data , but if you go with the 1 model approach and a general solution then you need to give them free reign on each page's entire layout
[20:30:20] AntelopeSalad: is there a simple way to iterate over every file/dir in a dir but then only get access to the relative paths of what it finds rather than the absolute paths?
[22:04:12] AntelopeSalad: what do you guys think is more idiomatic ruby?
[22:13:18] AntelopeSalad: havenwood: so you would say the #sub approach?
[22:30:17] AntelopeSalad: shevy: what approach would you take?
[22:39:45] AntelopeSalad: shevy: yes i do need it


[16:49:05] AntelopeSalad: ps cax is nice for finding just pids
[16:51:38] AntelopeSalad: i wonder what server you guys use where it's a problem
[16:51:59] AntelopeSalad: i've never had puma not shut down normally with a ctrl+c
[16:52:22] AntelopeSalad: only problem i've come across is with rails 4.1+, sometimes an old spring server stays running if your app crashes
[16:52:29] AntelopeSalad: then it makes future generators hang
[16:53:04] AntelopeSalad: slash_nick: oh, i never used jruby
[17:00:51] AntelopeSalad: workmad3: have you ever used logstash?
[17:02:21] AntelopeSalad: oops, i just clicked the link and started looking
[17:03:21] AntelopeSalad: workmad3: was logstash too heavy or you had other reasons?
[17:08:06] AntelopeSalad: logging is the next thing i want to tackle
[17:08:31] AntelopeSalad: i want to take like 6 different log sources and somehow get them to write to a single file (and then later write to a stream that will get consumed by something else)
[17:12:07] AntelopeSalad: what about syslog-ng?
[17:12:17] AntelopeSalad: or is that just a service
[17:12:43] AntelopeSalad: i vaguely remember hearing syslog, rsyslog and syslong-ng thrown together in the same topic
[17:13:42] AntelopeSalad: so they offer an open source package but then sell a web interface i guess?
[17:14:43] AntelopeSalad: i googled and saw this
[23:53:48] AntelopeSalad: mubi: try this
[23:59:25] AntelopeSalad: opus: i didn't even read your problem, i thought the other dude was asking a question on testing in production mode locally while using heroku
[23:59:56] AntelopeSalad: if it's only happening in production then maybe check your gemfile for gems that load only in production?


[00:01:15] AntelopeSalad: battling python 2 vs 3 is really frustrating
[00:02:27] AntelopeSalad: george2: what bothered me was the fragmentation in the community
[00:04:01] AntelopeSalad: there's pp too
[00:04:48] AntelopeSalad: i always use "puts"
[00:05:57] AntelopeSalad: hmm p actually seems better than puts in a lot of cases
[00:06:15] AntelopeSalad: since it does .inspect


[23:52:28] AntelopeSalad: there's not enough boilerplate in that code imo
[23:53:29] AntelopeSalad: i think it can be improved upon by having "self." in front of those instance variables?
[23:56:03] AntelopeSalad: george2:
[23:56:48] AntelopeSalad: unfortunately there's not as fool proof as pep8
[23:57:17] AntelopeSalad: , that is the closest you'll find i think


[00:06:28] AntelopeSalad: Georg3: i have this problem too at times, i guess the best bet is to become very familiar with the methods that ruby offers you
[00:09:18] AntelopeSalad: yeah i know the feeling, just 30min ago i was ready to write like 100 lines of horrible but working code , but ruby had a built in that let me do it in 2 lines
[15:34:31] AntelopeSalad: when using sort_by on an array that contains hashes as each element, you can pass in a block to sort on a specific key , but yesterday someone informed me you can do even more by adding...
[15:35:17] AntelopeSalad: {value_a: 1, value_b: 2, value_b: 3}[hash[:value_key] , to do a custom sort order
[15:35:33] AntelopeSalad: it works but where is this documented?
[15:35:48] AntelopeSalad: it seems like such an obscure but excellent feature
[15:40:02] AntelopeSalad: apeiros:
[15:40:53] AntelopeSalad: apeiros: not by multiple values but provide a custom "algorithm" to sort the hash keys on
[15:41:10] AntelopeSalad: element is the current element in the sort_by block
[15:41:45] AntelopeSalad: without the custom sorting, it would output them in alphabetical order
[15:42:33] AntelopeSalad: {red: 1, yellow: 2, green: 3}[element[:color]] vs element[:color]
[15:42:38] AntelopeSalad: the second one is alphabetical
[15:43:07] AntelopeSalad: the part i don't get is , {red: 1, yellow: 2, green: 3}[element[:color]]
[15:43:16] AntelopeSalad: i mean i get what the output is but what is this called?
[15:43:30] AntelopeSalad: you're passing an array to a hash and using it as a function or something, wtf? heh
[15:44:33] AntelopeSalad: ah, i didn't know you could access a hash like that
[15:45:17] AntelopeSalad: so it's the same as looking up an index in an array ( [] syntax ) , except you can pass in a key name
[15:45:58] AntelopeSalad: yeah, the {} threw me off i guess
[15:46:04] AntelopeSalad: but element evaluates to the same thing
[15:46:39] AntelopeSalad: you're working on a hash in both cases, it's just assigned to a variable vs not
[15:48:23] AntelopeSalad: thanks for clearing that up, now it all makes sense


[23:18:35] AntelopeSalad: does sort work the same way? i can just pass in a block with the hash key?
[23:20:00] AntelopeSalad: sort doesn't seem to work in a way that i need it to
[23:20:49] AntelopeSalad: at least not in the same way as uniq worked
[23:21:29] AntelopeSalad: i get the new list back with the duplicates removed , but the color order is out of whack
[23:24:36] AntelopeSalad: ari-_-e: hmm, it's in order with the sample data i gisted
[23:25:36] AntelopeSalad: nothing, that was without any custom sorting
[23:26:14] AntelopeSalad: nope, just arr.uniq { |item| item[:name] }
[23:27:16] AntelopeSalad: oh i see, with my real data the colors aren't in order
[23:27:28] AntelopeSalad: so now the issue becomes sorting them by color
[23:27:53] AntelopeSalad: arr.sort { |item| item[:name] } , that was a semi-expected syntax error
[23:28:02] AntelopeSalad: i've never really used sort in a non-default way
[23:29:18] AntelopeSalad: correct, that was just me being stupid
[23:32:34] AntelopeSalad: ari-_-e: seems like it works if i use sort_by instead of sort
[23:32:53] AntelopeSalad: but then it sorts in green, red, yellow order which is expected since that's the alphabetical order
[23:33:40] AntelopeSalad: it's not but maybe a reasonable solution would be to add a new key like "order" and give it 0, 1, 2
[23:33:42] AntelopeSalad: and then sort on that key?
[23:34:08] AntelopeSalad: ok thanks, i'm so happy a nice solution existed
[23:34:31] AntelopeSalad: i was ready to go full blown imperative madness which would have been like 100 lines of face palming
[23:35:57] AntelopeSalad: which one do you think is more clear?
[23:37:28] AntelopeSalad: ari-_-e: ok thanks, i'll keep both solutions in mind