makandra dev
tech.taskrabbit.com

...our app(s). In the beginning, there was the monolithic Rails app in the standard way with 100+ models and their many corresponding controllers and views. Then we moved to...

...between the (initial) straightforwardness of the single Rails app and the modularity of the more service-oriented architecture...

makandra dev
pdfposter.origo.ethz.ch

Pdfposter is a Python script that allows to convert large PDFs into a PDF with multiple pages that can be printed and turned into one big poster. In Ubuntu, you...

...can install it with sudo apt-get install pdfposter Scaling to the desired size is a bit cumbersome. If you want to split large.pdf, I suggest you run pdfposter -vns...

You can use gem list to list all gems available from a remote gem server: gem list -r --clear-sources -s 'https://user:password@gemserver.tld/' This is useful to debug cases...

...where Bundler complains of a gem existing in more than one gem source...

makandra dev

You may omit the /path/to/link_name to have a link with the same filename appear in the current directory

It's that simple to allow one of your Linux users to run a single command as UID 0: sudo visudo Add the line below to allow user 'deploy' to...

There is a bug in Rails 3's dbconsole script, which makes the following command open a database console for the development environment: rails dbconsole -p test

blog.plataformatec.com.br

...that you want to provide default views for a group of controllers. Let’s say you have a bunch of controllers inside the Admin namespace and you would like each...

...action for Admin::PostsController and “app/views/admin/posts/index.html.*” is not available, it should then render “app/views/admin/defaults/index.html”. Since Rails 3.0, we have a new abstraction called resolvers that holds the logic to find...

makandra dev

This will reduce the filesize of foo and bar to 0 bytes: truncate -s0 foo bar If the files do not exist they will be created. You can use this...

...to easily truncate your application's log files: truncate -s0 log/*.log

...have to write an HTML message for some weird reason. Here is how: Hold the Shift-Key while clicking on "Write", "Reply", "Reply All", or "Forward".

makandra dev
ablogaboutcode.com

...the following way: if object is a block, it converts the block into a simple proc. if object is a Proc, it converts the object into a block while preserving...

...the lambda? status of the object. if object is not a Proc, it first calls #to_proc on the object and then converts it into a block...

Let's say you have a folder images and want to to move all files in there to a new subfolder public. cd images mkdir public mv !(public) public

...public) excludes the new subfolder itself from being moved...

...its columns, you can use the following CSS property: table-layout: fixed It is supported by every browser ever...

guides.rubyonrails.org

When running migrations with rake db:migrate, there's the STEP and VERSION parameters that you can pass to nearly all commands. # Migrate rake db:migrate rake db:migrate STEP...

...rake db:migrate VERSION=20080906120000 # Redo rake db:migrate:redo rake db:migrate:redo STEP=2 rake db:migrate:redo VERSION=20080906120000 # Rollback (starting from latest migration) rake db:rollback...

...and titles, like [#15775609] Index view for conflicts The geordi command commit automates this. (See: Pretty Commit messages via geordi). Just run geordi commit and it will connect to PT...

...and let you select from a list of all started and finishes stories. Then it runs git commit with the generated message (i.e. all staged changes will be commited).

makandra dev
skillsmatter.com

With Rails 4, Concerns have become the “official” solution to the big-models problem. However, there’s a fair amount of controversy about this topic in the community. Not everyone...

...is convinced that Concerns are the “right“ solution to the problem of AR models becoming too big. In this talk we will see what Rails Concerns are and how can...

When you put a Rake task into lib/tasks, but running it fails with... Don't know how to build task...

...or overflow directives in your CSS. Remove and tags in proximity of your table (seriously...

makandra dev
ruby-doc.org

not or and if unless while until begin/end For more information see Table 18.4 in The Pragmatic Programmer's Guide...

Safari & Chrome Use $x() in your console: $x('//span') # selects all span elements Firefox There's an add-on...

E. g. in the following example, Array could mean either Foo::Array or simply Array: class Foo def list Array.new end end What Ruby does here is to see...

...if the name Array makes sense inside of Foo::, and if that fails, resolves it to ::Array (without a namespace). The bad This is relevant for old Ruby versions. Ruby...

wiki.snom.com

If your Snom 300 always keeps the same volume for headset and ringtone (as soon as you change one you also change the other), here's what to do:

...to your phone settings web interface, then Preferences (German Präferenzen). There is the seemingly harmless setting for Ringer Device from Headset (German Klingeltonausgabe bei Kopfhörer). Choose one: "Headset" or "Speaker...

stritar.net

Since I'm a software architect and a web developer, I get often approached by people with their new ideas. In most cases, for some quality feedback, and on lucky...

...rough quote about the costs of such a project. These people are usually very secretive about what they have, making me explain to them that it's far from my...

stackoverflow.com

url = 'http://www.foocorp.com/foo/bar' URI.parse(url).host # => www.foocorp.com Note that this will raise an error if the given argument is...

jetbrains.com

...base revision from which both conflicting versions are derived You can also use a similar pane view to compare to files. Mark two files and press Ctrl + D to compare...