Option 1: Creating a self-signed certificate with the openssl binary As igalic commented on this gist. openssl req -new...

Getting a regular expression from a string in JavaScript is quite simple: new RegExp('Hello Universe'); # => /Hello Universe/

When HTTP clients make an request they can define which response formats they can process. They do it by adding...

Authentication is hard: there are many edge cases, and most users (including yourself) usually only go the "happy path" once...

We have often felt the pain where our models need to serve too many masters. E.g. we are adding a...

When you want to do a git diff but do not care about the full diff and just want to...

Create a directory mkdir ~/.aws Initialise git repository cd ~/.aws && git init Create a git branch with a name you...

You probably haven't configured version control for your project. Go to Project Settings / Version Control and set the director...

We ran into trouble when adding additional compute units to our railscomplete Hosting environment lately. VM-instances on the new...

When you download or upgrade RVM it has a hardcoded notion which patch level it considers to be "1.9.3".

highscalability.com

Awesome battle report from Pinterest trying to scale their setup using different approaches. When you push something to the limit...

tl;dr: Ruby's Bundler environment is passed on to system calls, which may not be what you may want...

github.com

When using the json gem, you might run into this error when using JSON.parse: >> json = 'foo'.to_json >> JSON.parse(json...

Rails gives you migrations to change your database schema with simple commands like add_column or update. Unfortunately these commands...

Caution when using .where to exclude records from a scope like this: # Fragile - avoid User.where("id NOT IN (?)", excluded_ids...

This only works when you actually have a session ID (not the case for Rails' CookieStore, for example): request.session_options...

In specs, the session never persists but is always a new object for each request. Data put into the session...

developer.mozilla.org

Non-SSL contents on SSL pages are blocked by default Bug 834836 – Turn on pref to block mixed active content...

apidock.com

All columns of a model's database table are automagically available through accessors on the Active Record object.

thejh.net

What you copy may not be what you see in the browser. Here is an online tool to determine the...

Note: This technique is confusing and slows down your test suite. Copy the attached code to features/support. This gets you...

stackoverflow.com

Usually, the logrotate service takes care of renaming log files each night or so to avoid logs becoming huge. That...

stackoverflow.com

TL;DR: Variables not declared using var are stored outside the current scope, most likely in the global scope (which...

stackoverflow.com

When you use ab to do some performance benchmarking, you might run into output like this: Complete requests: 200