News for hackers. Stuff that matters.

arthurschreiber

Re:Partitioning GitHub’s relational databases to handle scale on Tuesday September 28, 2021 @11:27AM (#28683938)
We could enable the linter in production to silently log problematic queries without actually affecting their execution.

If we used separate db users as you're suggesting, any query that we didn't catch beforehand (e.g. via our CI builds) would cause noticeable problems for our users, which is something that we want to avoid.

Additionally, switching to a separate user account would require holding open twice the amount of connections to each database server (old db user plus new db user), which probably would be fine but is still a lot of additional connections at our scale.

Re:Partitioning GitHub’s relational databases to handle scale on Tuesday September 28, 2021 @11:04AM (#28683636)
As described in the blog post, large paths of our database schema have grown in an organic fashion. These virtual partitions allow us to prepare our database access for splitting out groups of tables into separate clusters in the medium term, with sharding those clusters being a next step and a long term solution to handle our database growth.
Re:Partitioning GitHub’s relational databases to handle scale on Tuesday September 28, 2021 @09:10AM (#28682325)
We wrote our own linters that hooked into the `sql.active_record` event emitted by ActiveRecord when a query gets executed.

See https://api.rubyonrails.org/classes/ActiveSupport/Notificati... for the API to subscribe to these notifications.

Re:Update on 1/28 service outage on Friday January 29, 2016 @11:33AM (#10996201)
Unless I'm mistaken, 97% of (24 hours) = 23.28 hours.
I really like docopt (http://docopt.org/) which also comes as a CoffeeScript / JavaScript version.
Re:SQL injection search on Saturday June 01, 2013 @04:56PM (#5805974)
That's _exactly_ what XSS is about. One possible way to exploit things like this is if I send you a link to a website, that embeds the target page through an iframe with javascript output injected. I could then have the JS steal your cookies/session or worse.
Re:The Pull Request Hack on Monday March 11, 2013 @01:07PM (#5358073)
This is similar to how the Rubinius project has been managed for a long time: After your first pull request gets merged, you'll be added to the repository as a committer.
Re:Tcl the misunderstood (2006) on Saturday December 15, 2012 @07:55AM (#4925221)
I also created a very rspec like bdd library, called tclspec: https://github.com/arthurschreiber/tclspec
Re:HAML vs ERB vs SLIM in terms of render speed on Wednesday October 17, 2012 @01:28PM (#4665533)
I'd even say that the biggest contributor to this difference is the non-blocking nature of Node. Using e.g. EventMachine would probably close the Gap between Node and Ruby even more.
Re:HAML vs ERB vs SLIM in terms of render speed on Wednesday October 17, 2012 @09:57AM (#4664417)
Well, that comparison is not exactly fair, is it?

While the rails benchmark tries to compare different template engines in the same language, framework, and with blocking IO, you're comparing these results to rendering under "pure" Node.js (no framework that slows you down) with non-blocking IO.

Don't take this the wrong way, tho, I'm absolutely blown away by your numbers!

Re:Core Values on Tuesday October 09, 2012 @03:17AM (#4630385)
I'm confused, is this not what generally is done (and works) in open source development?
Re:RSpec Best Practices on Wednesday October 03, 2012 @12:15PM (#4608150)
To be honest, I think both styles are good practice, but it totally depends on the context. For example, if I want to describe how the "#admin?" method is working, I'll use

    describe "#admin?" do ...
but if I'm describing a different method, that does different things depending on whether the user is an admin or not, I'll do the following:

    describe "#some_other_method" do
      describe "if the user is an admin" do
        ...
So you can mix and match both styles, depending on what exactly you're describing (and it's context).

If you're looking at the OP more closely, it even says this is only recommended for "describing methods".

Re:How Ruby Borrowed a Decades Old Idea From Lisp on Tuesday September 18, 2012 @02:10PM (#4539598)
Well, but Tcl blocks are nothing more than strings that you pass as arguments that then get eval'ed using uplevel. Ruby blocks are "real" language constructs, and are real closures, in difference to Tcl blocks.
Re:HP introduces new Apple iMac on Monday September 10, 2012 @01:26PM (#4500900)
Not having an aluminium bar at the bottom makes it very much look like the Apple Cinema Display, though.
Re:Show HN - Github competitor with free private repo on Friday August 24, 2012 @06:37PM (#4430040)
Hah! Your pull request actually introduces subtle bugs into the diff view. I had already submitted _exactly_ the same change some months ago, and after having it enabled for some time in our gitlab installation at work, I ran into some issues.

I can't remember the exact preconditions, but there were cases where this change would start showing changes that were not even part of the merge request at all, which was extremely confusing.

In the end, I went ahead and did some more low-level changes to gitlab, so it would not only save the branch for a merge request, but it would save the actual commit shas of the source revision. That was much more accurate and reflects the way pull requests work on Github.

Re:Show HN - Github competitor with free private repo on Friday August 24, 2012 @05:15PM (#4429704)
Yes. Just check this model, for example: https://github.com/gitlabhq/gitlabhq/blob/master/app/models/...

I'm pretty sure it should have it's attributes protected.

Also, prepare to have to work with pretty confusing code. I don't want to belittle the work of the Gitlab authors and contributors, but the whole codebase is ignoring many Ruby, Rails, Webdevelopment and general programming best practices.

A short list of problems, at least in my eyes, and in no specific order: * Obtrusive JavaScript inside the erb templates, inline style definitions * Non-semantic css class names. * Highly confusing controller code (filters are used to set all kinds of instance variables, which makes it very hard to easily understand where the variable is coming from and what it's value is). * "Roles": Code that has been extracted into seperate modules, but for no real reason. E.g. the SshKey module is only included into the Key class, and is highly coupled with it. * Totally brittle test suite.

Re:Show HN - Github competitor with free private repo on Friday August 24, 2012 @04:05PM (#4429371)
Be sure to take a closer look at the Gitlab source code. The last time I did, they still were vulnerable to exactly the same attacks that were also demonstrated to work on Github some time ago.
Re:Live Streaming in Rails 4.0 on Tuesday July 31, 2012 @10:44AM (#4317476)
Yes, but enumerators are (in most cases) implemented with Fibers. So you're going to get hit with at least some performance degradation.
Re:MVC may be Slowing Down Your Site on Tuesday July 03, 2012 @12:26PM (#4194780)
As others have already pointed out, that has nothing to do with MVC, but is more a result of how template engines usually work.

E.g. in Rails, by default, due to the fact that you can have views provide content for your layout (using content_for), it has not been possible to start sending your rendered HTML before the rendering was completely finished.

There is an experimental Fiber based solution in Rails Core, that shipped with 3.2, that kind of fixes that issue, but only to a certain degree (see http://api.rubyonrails.org/classes/ActionController/Streamin...).

Re:Laravel : A New PHP Framework on Sunday May 27, 2012 @01:33PM (#4030546)
Yes, but their Model layer, in comparison with what ActiveRecord provides you with, is really not that great. One of the main aspects that I really didn't like was that the Model finder methods don't give you object instances back, but instead you get php arrays with the fetched data from the database.
I'm only guessing, but I'd say with the release of Github for Mac 1.2.
Re:The Underpants Project on Monday April 23, 2012 @10:24AM (#3878927)
Same here. That's really creepy. :/
Re:This Is 2016 Not 2012 on Sunday April 22, 2012 @01:05PM (#3875367)
Wasn't there some actual recruiter offering DDH a senior rails developer position? I'm pretty sure I read about that in DHH's twitter stream some time ago.
Re:The GitHub Styleguide on Friday April 06, 2012 @06:25AM (#3806603)
Usually you will have another level of indentation, so class methods shouldn't be that easy to mistake for instance methods.
Re:OSX For Hackers on Saturday March 31, 2012 @08:55AM (#3780206)
How often do you come across the need to type in your password? Personally, I do not have to do that too often, and when I have to it usually makes sense to re-authenticate.
Re:Why Node.js streams are awesome on Sunday March 25, 2012 @10:47AM (#3752715)
I don't know the Play! framework, but the main difference probably is the use of nonblocking IO in nodejs, in contrast to blocking IO in the example you just have given. (I'm not saying either is better).
Re:The H264 time bomb will kill us all in 2015, run on Wednesday March 21, 2012 @05:24AM (#3733660)
An Open Source h264 Encoder.
Re:Poll: Hackernews Meetup: Stuttgart, Germany on Tuesday February 21, 2012 @06:13AM (#3616083)
I'd be interested, too.
I encrypted my SSD using BitLocker, and for me, the performance hit is not really noticable in my day-to-day work (programming + running a virtual machine). Your SSD will still be A LOT faster than a regular, unencrypted HDD. But YMMV.
Re:DeSopa: a Firefox addon to easily bypass SOPA DNS blocking on Tuesday December 20, 2011 @02:40PM (#3374797)
xpi files are "normal" renamed zip files. Try extracting the contents using your favorite unzipping application. You should then get access to the source files.

Older »