Activity Graph

Page 1 of 19 | Next »


[21:57:25] bricker`work: tubbo: technically, before/after_save
[22:00:52] bricker`work: amdbcg: best way is with <ul> or <ol>
[22:01:35] bricker`work: amdbcg: doesn't matter, the two are the same thing.
[22:01:53] bricker`work: amdbcg: habtm is just a has_many :through that hides the join model from you.
[22:02:50] bricker`work: kryptonradon: request.headers[''] is nil? Throws an error?
[22:03:14] bricker`work: kryptonradon: then the header you're looking for is missing.
[22:03:29] bricker`work: kryptonradon: inspect request.headers and see what it returns
[22:15:21] bricker`work: kryptonradon: is this in a test (eg Rack::Test)?
[22:16:37] bricker`work: kryptonradon: Rails normalizes the headers in that way
[22:16:43] bricker`work: HTTP_YOUR_COOL_HEADER
[22:19:05] bricker`work: kryptonradon: either Rack or Rails converts the headers, I don't know which
[22:19:31] bricker`work: Radar: sure?
[22:20:06] bricker`work: it looks like this has happened since at least Rails 3
[22:20:19] bricker`work: introduced in rails 2 maybe
[22:21:04] bricker`work: Radar: did your headers in Rails 3 *also* have HTTP_AUTHORIZATION?
[22:21:14] bricker`work: Radar: i.e., maybe it did bot has deprecation
[22:21:54] bricker`work: "maybe it did bot has deprecation" is my new slogan
[22:23:48] bricker`work: Here's a Rails 4 app that uses normal header:
[22:23:57] bricker`work: Maybe Origin is not modified in that way
[22:24:48] bricker`work: Radar: Tests I have found to behave differently
[22:26:54] bricker`work: Radar: so I wonder if 'Origin' is purposefully whitelisted or something
[22:37:21] bricker`work: Radar: he's just crafting a really thorough response
[22:38:05] bricker`work: DaniG2k: you just don't know how to do it :)
[22:38:41] bricker`work: aww that's sad
[22:38:54] bricker`work: DaniG2k: once you do one it's nbd after that
[22:39:21] bricker`work: latco: throw your computer away, buy a new one
[22:40:10] bricker`work: DaniG2k: *frysquint*
[22:40:20] bricker`work: DaniG2k: what does it use?
[22:40:26] bricker`work: to do the search?
[22:41:13] bricker`work: DaniG2k: You're going to custom build a search engine? Good luck! look how ElasticSearch or ThinkingSphinx do it
[22:41:28] bricker`work: although I don't think either are technically engines
[22:42:31] bricker`work: bato: yes, don't load the environment, i.e. don't specify 'environment' task as a prereq
[22:43:24] bricker`work: DaniG2k: It's not insane to learn!
[22:47:19] bricker`work: Radar: aw he's just learning
[22:48:33] bricker`work: "SELECT * FROM `posts` WHERE `body` LIKE %#{query}%"
[22:48:37] bricker`work: ^ custom search engine
[22:51:17] bricker`work: workmad3: it's not SQL
[22:51:30] bricker`work: workmad3: can you guess what that stands for
[22:51:36] bricker`work: it's really clever
[22:52:09] bricker`work: All of these things
[22:55:25] bricker`work: ACTION 1,000 brickercoins to tubbo
[22:55:29] bricker`work: for a joke he made like 2 years ago
[22:55:49] bricker`work: the royalties on that one will send your kids to bricker college
[22:58:08] bricker`work: bato: what is the task
[22:58:12] bricker`work: please gist it
[22:58:20] bricker`work: please show the command you're using ot run it
[23:03:06] bricker`work: jhass: reminds me of :)
[23:04:36] bricker`work: jhass: I thought "CommonMark" and "BabelMark" were two different syntaxes, didn't realize they were implmentations
[23:05:04] bricker`work: bato: check the configuration assets.initialize_on_precompile
[23:05:32] bricker`work: is this rails 3 or 4? I think it was removed in rails 4
[23:05:48] bricker`work: I see that it's rails 3
[23:06:08] bricker`work: add initialize_on_precompile=false to your application.rb
[23:06:47] bricker`work: anyways that error looks like your DB server just isn't running
[23:15:37] bricker`work: lololololilililililililolololo
[23:33:12] bricker`work: morenoh149:
[23:33:16] bricker`work: look for "Rendering JSON"
[23:43:28] bricker`work: Fire-Dragon-DoL: do you mean `find_by_id!`?
[23:43:49] bricker`work: Fire-Dragon-DoL: also, `find_by_id!` would raise RecordNotFound, not return nil
[23:44:06] bricker`work: Fire-Dragon-DoL: I've never used nor seen `find!`
[23:45:13] bricker`work: Fire-Dragon-DoL: I just tried, `find!` isn't a method
[23:45:25] bricker`work: I tried in 4.1 though
[23:46:09] bricker`work: Fire-Dragon-DoL: show me the time that it worked
[23:47:56] bricker`work: Fire-Dragon-DoL: Cmd+F
[23:51:17] bricker`work: Fire-Dragon-DoL: :)


[18:12:59] bricker`work: hotpancakes: rm -rf vendor/cache, and you'll also need to modify your `.bundle/config` file to remove the CACHE_ALL configuration (otherwise, the next time you bundle-install it'll just put them back into vendor/)
[18:25:00] bricker`work: tejas-manohar: Rails won't be your bottleneck, if that's what you're asking. Speed depends on a lot of things, the framework you happen to be using is only a small part of it.
[18:25:19] bricker`work: tejas-manohar: if you cache intelligently, it won't matter how your API is implemented
[18:31:05] bricker`work: tejas-manohar: *shrug*
[18:31:39] bricker`work: I used to have multiple nicks but now I'm only really in here when I'm at work


[01:26:11] bricker`work: weaksauce: it's just part of activerecord now


[00:02:03] bricker`work: towski_: just use `DateTime.strptime("Thu Dec 18 13:38:25 2014 +0200", "%c %z")`
[00:02:12] bricker`work: easy, no muss, no fuss
[17:43:29] bricker`work: THREE WHAT?!?!?!
[17:43:32] bricker`work: I have to know.
[18:05:26] bricker`work: athan: use rails console
[18:05:39] bricker`work: athan: that's exactly what rails console is - an IRB session with the rails environment loaded
[18:10:09] bricker`work: athan: What are you looking for by calling "MyModel.inspect?
[18:19:49] bricker`work: athan: the name method is defined dynamically by active record. If you want to hook into the persistence lifecycle of an AR object, you should use callbacks.
[18:20:00] bricker`work: athan:
[18:23:39] bricker`work: eka: What do you mean exactly?
[18:24:15] bricker`work: eka: you can try a HEAD request and check the content type, size, status, etc,
[18:25:11] bricker`work: eka: I would just do a simple HEAD request and make sure you get a 200 response
[18:26:13] bricker`work: eka: yeah, ` == "200"`
[18:26:14] bricker`work: something like that
[18:38:25] bricker`work: Darkwater: get ':id', to: 'articles#show' or whatever
[18:38:51] bricker`work: Darkwater: I recommend not doing that, it's a long, dark path that will drive you to insanity
[18:39:14] bricker`work: Darkwater: yeah
[18:39:25] bricker`work: Darkwater: root to: 'articles#index'
[18:41:04] bricker`work: godd2: did you just have a stroke?
[18:41:11] bricker`work: tmp var cersion
[18:41:29] bricker`work: Darkwater: yes
[18:41:47] bricker`work: Darkwater: it may not be the same as the version of rails your app is written for
[19:21:18] bricker`work: tubbo: since when?
[19:26:13] bricker`work: axilla: what is it
[19:33:57] bricker`work: tubbo: db:migrate has never changed the test db in my experience
[19:39:03] bricker`work: joshua-anderson: uh-huh
[21:23:21] bricker`work: gareim: get 'about', to: 'controller#about'
[21:34:41] bricker`work: root-level globbing is a nightmare
[21:34:58] bricker`work: unless you're using it for 404 fallback
[21:47:14] bricker`work: DasLumberJackYa: Material.joins(:rundatum).where(rundata: { run_id: params[:id] })
[21:48:04] bricker`work: DasLumberJackYa: ye olde pg error
[21:49:07] bricker`work: DasLumberJackYa: the key in the hash needs to be the name of the table, always kind of felt weird to me but that's the way it is
[21:51:42] bricker`work: DasLumberJackYa: no, neither of those things would have made a difference
[21:52:05] bricker`work: TeresaP: for what?
[21:52:44] bricker`work: you were using the name of the association name in the conditions, right?
[21:52:48] bricker`work: not the table name
[21:55:47] bricker`work: TeresaP: that leading slash is problematic I bet
[21:55:54] bricker`work: on the second URL
[22:12:58] bricker`work: maxd: initializer accepts a string, not a URI
[22:14:26] bricker`work: maxd: call uri.request_uri when intiailizting the Get object
[22:14:39] bricker`work:
[22:14:48] bricker`work: "Returns the full path for an HTTP request, as required by Net::HTTP::Get."
[23:15:53] bricker`work: new_i = %w[ aac wmav2 mp2 mp3 ].find { |s| old_i.include?(s) }
[23:32:08] bricker`work: crankharder: you might like the github CLI:
[23:32:35] bricker`work: "check out a pull request for review" git checkout -> creates a new branch with the contents of the pull request


[00:02:22] bricker`work: rubyonrailed: depends if you want it do a deep comparison
[00:06:44] bricker`work: rubyonrailed: you can use Hash.diff, but it doesn't recurse
[00:08:51] bricker`work: rubyonrailed: that is not correct
[00:09:41] bricker`work: rubyonrailed: you can zip the keys in with it
[00:09:59] bricker`work: rubyonrailed: something like, Hash[]
[00:10:05] bricker`work: with a * in front
[00:10:12] bricker`work: gotta run sorry :P lol
[00:44:21] bricker`work: rubyonrailed: I'm back. You can't just substract the values like that, because if there are values that are they same they will all get removed
[00:48:43] bricker`work: hydrajump: what's it pay?
[01:02:36] bricker`work: dynomist: yeah those are Test::Unit, delete the test directory and run `bundle exec rails g rspec:install`
[01:04:23] bricker`work: hydrajump: there is a reason people pay a shitload of money to post jobs on basecamp, github, etc... Legitimacy of clients is important for freelancers.
[01:06:22] bricker`work: dynomist: be sure to add rspec-rails too to get the generators
[01:06:46] bricker`work: dynomist: you can re-run your scaffold commands to get the rspec files, it won't overwrite your existing models, controllers, etc.
[01:07:27] bricker`work: dynomist: there are no default tests for rspec though, as far as I know, it just makes an empty file for you with a root-level 'describe' block.
[01:08:03] bricker`work: dynomist: Good for you
[01:38:33] bricker`work: who waits their turn to ask a question in IRC?
[01:38:43] bricker`work: I've never once felt or seen that
[01:48:42] bricker`work: jtdoncas: make another serializer, it's the right thing to do
[01:49:27] bricker`work: timiyay: what makes you think it has to do with sass? Gist the stack trace
[01:50:18] bricker`work: timiyay: that error could be a lot of things. Gist the full stack trace
[01:50:25] bricker`work: timiyay: and the template causing the error
[01:50:59] bricker`work: timiyay: which line is line 5 of that file?
[01:51:20] bricker`work: timiyay: oh, I think the problem is your lack of parentheses
[01:51:25] bricker`work: timiyay: in the link_to line
[01:53:45] bricker`work: I'd just use a damn <a> tag :)
[01:55:04] bricker`work: Ziggy: eh, I disagree, not worth arguing about though (I've had this argument many times with many co-workers... nobody ever wins)
[02:01:11] bricker`work: Ziggy: yeah but the path helpers aren't so ugly
[02:01:26] bricker`work: Ziggy: and in Slim it's just a href="#{news_path}" or whatever
[02:01:39] bricker`work: a href=news_path might even work, I forget
[02:09:08] bricker`work: rubyonrailed: That is probably outputting an array though, you probably want to wrap it in Hash[]
[02:09:16] bricker`work: if you indeed want a hash
[06:52:58] bricker`work: Ruby golf: I want to rotate an array to only ever keep 5 elements in it, the most recent at the start. Right now I have `array.pop if array.length >= 5; array.unshift(element)`
[06:53:01] bricker`work: Can I do better/
[06:58:17] bricker`work: This works: ary.unshift(element).replace(ary.first(n))
[17:33:11] bricker`work: In your opinion, for a JSON API, are Javascript timestamps or unix timestamps better for time attributes?
[18:39:53] bricker`work: SomeKittens: that's the one I use
[18:44:23] bricker`work: loc22: Ticket.joins(:users).where(users: { ticket_id: nil })
[18:49:25] bricker`work: pipework: what do people use now?
[18:52:41] bricker`work: pipework: right, but which ruby interface for ImageMagick has replaced RMagick?
[18:53:44] bricker`work: tubbo: in the past I've done that by setting defaults: { format: :txt } in routes
[18:53:54] bricker`work: tubbo: or :json or whatever
[18:54:32] bricker`work: tubbo: here's an example:
[21:46:31] bricker`work: sha1sum: please gist stack trace and error
[21:48:09] bricker`work: sha1sum: also check `rake routes` to make sure the path is what you expect it to be
[22:01:19] bricker`work: Zleec: correct.
[22:01:57] bricker`work: eh. They also don't compliment each other necessarily. They are just two totally, completely separate things.
[23:30:21] bricker`work: Cache_Money: yeah, generally you'd see /forums/:forum_id/topics/new
[23:42:16] bricker`work: Ryan1013: you gotta rename that thing dude
[23:42:49] bricker`work: Also I already wrote one of these >:) It's called Speakeasy and you're now jealous how good that name is
[23:43:52] bricker`work: Ryan1013: in Settings
[23:45:46] bricker`work: Ryan1013: it's the first thing at the top of the page
[23:45:52] bricker`work: There's a big button that says "Rename"


[21:47:26] bricker`work: s2013: what is his concern?
[21:47:30] bricker`work: with redis or memcached
[21:49:12] bricker`work: *shrug* it happens, people are protective of IP
[21:59:22] bricker`work: TheAtomicGoose: Not in any elegant way. One the link is clicked, the user will be sent somewhere. The closest you can get, I think, is to add a query param to the link ("show_partial=true") and check that flag in the template.
[22:01:40] bricker`work: TheAtomicGoose: why can't you use JS?
[22:03:36] bricker`work: TheAtomicGoose: pretty good place to start too. Render the partial always, and hide it by default. Then the link can just toggle that Div.
[22:04:15] bricker`work: TheAtomicGoose: style="display:none"
[22:04:17] bricker`work: TheAtomicGoose: (CSS)
[22:04:39] bricker`work: tubbo: yeah it's annoying
[22:07:20] bricker`work: tubbo: I gave up after trying for a bit
[22:22:05] bricker`work: dandaman: probably
[22:22:17] bricker`work: bumptious: it definitely executes more than once
[22:22:30] bricker`work: bumptious: pretty lame if you ask me, especially if you are generating random filenames
[22:22:35] bricker`work: has caused me headaches in the past
[22:24:10] bricker`work: bumptious: For me it was only being called twice.
[22:26:30] bricker`work: bumptious: is it causing a problem for you? You can just memoize the filename method.
[22:37:04] bricker`work: TheAtomicGoose: Yes.
[22:39:31] bricker`work: TheAtomicGoose: no, it wouldn't be part of the render call, just make it part of one of the templates.
[22:41:14] bricker`work: TheAtomicGoose: see this section: You'll want the :css filter
[22:41:54] bricker`work: TheAtomicGoose: or just put it inline on whatever element you're trying to style\
[22:48:10] bricker`work: tubbo: is the "clear_cache" task in your deploy file? I see its in the default deploy.rb template
[22:48:58] bricker`work: Scriptonaut: it doesn't work like that, you'll have to do You can delegate if you want, but that would defeat the purpose of polymorphism
[23:04:42] bricker`work: Scriptonaut: unlikely
[23:06:28] bricker`work: black magic, I guess
[23:08:58] bricker`work: xibalba: I know >:)
[23:21:30] bricker`work: ZiggyTheHamster: ruby has getters and setters
[23:21:42] bricker`work: ZiggyTheHamster: and, in fact, they work exactly the same as Java
[23:22:18] bricker`work: def column=(), def setColumn(), whatever you name your method, it's a setter
[23:24:14] bricker`work: ZiggyTheHamster: you're right, you can call your setter whatever you want, but you can do that in Java too
[23:24:20] bricker`work: ZiggyTheHamster: I don't see why you brought Java into this
[23:28:09] bricker`work: fwaokda: it's a URL
[23:28:38] bricker`work: boombadaroomba: you need to use explicit returns if you want to format it like that
[23:28:53] bricker`work: boombadaroomba: personally I'd use a hash, you can also use a case statement
[23:29:01] bricker`work: fwaokda: please do
[23:29:48] bricker`work: fwaokda: I have been tricked into opening porn one too many times while trying to help people in this channel
[23:31:16] bricker`work: boombadaroomba: yeah, your problem is 'upcase!' probably. See the documentation:
[23:31:21] bricker`work: "... or nil if no changes were made"
[23:31:30] bricker`work: oops, fwaokda ^^
[23:31:38] bricker`work: boombadaroomba: yeah
[23:35:08] bricker`work: fwaokda: install pry, place 'binding.pry' in that method, write a simple test, run that test.
[23:37:13] bricker`work: ZiggyTheHamster: yes, it works
[23:37:34] bricker`work: The methods are defined dynamically, but they are defined. (i.e. it's not a method_missing fallback situation)
[23:53:12] bricker`work: lampd1: I'm confused, is your string "timeframe = \"q3\"" ?
[23:53:46] bricker`work: boombadaroomba: could be String vs. Symbol
[23:53:54] bricker`work: boombadaroomba: check that the key you're passing in is a symbol