Skip to content

Instantly share code, notes, and snippets.

View njonsson's full-sized avatar
🤝
Working @amzn but open to new opportunities

Nils Jonsson njonsson

🤝
Working @amzn but open to new opportunities
View GitHub Profile
@njonsson
njonsson / The difference between the junior and senior Rails developer
Created May 6, 2009 03:31
The difference between the junior and senior Rails developer — an extract of the discussion forum at the Rubyists LinkedIn group
Someone recently asked the following question in the discussion forum of the Rubyists LinkedIn group: What separates a junior Rails developer from a senior one?
My response follows. Join us at http://www.linkedin.com/groups?gid=120725 to weigh in on this and other topics of interest to Rubyists. As of today there are almost 1,200 members, including numerous movers and shakers in the Ruby and Rails communities.
“Distinguishing between junior and senior people in the Rails world is not so different from making the distinction in other web development environments.
“Junior Rails people have not dealt with scaling issues to the degree that senior people have. Getting a public-facing Rails application to perform under significant stress is more challenging than doing the same with other building materials such as PHP. Senior people know how to performance-test Rails applications, where to look for bottlenecks, and how to eliminate them one after another until performance is acceptable in real conditions. The Ra
@njonsson
njonsson / IMultiValueDictionary.cs
Created March 20, 2010 22:04
MultiValueDictionary, a generic collection of keys paired with zero or more values each
namespace System.Collections.Generic
{
/// <summary>
/// Represents a generic collection of keys paired with zero or more values
/// each.
/// </summary>
/// <typeparam name="TKey">The type of the keys in the
/// <see cref="IMultiValueDictionary{TKey,TValues}"/>.</typeparam>
/// <typeparam name="TValues">The type of the value list elements in the
/// <see cref="IMultiValueDictionary{TKey,TValues}"/>.</typeparam>
module DirectoriesAndFiles
module ClassMethods
def directories(path)
new(path).directories
end
def files(path)
new(path).files
require 'tevye'
poor_tevye = Tevye.new
result = catch(:miracle_of_miracles) do
poor_tevye.live
end
rich_tevye = Tevye.new
def rich_tevye.rich_man?
true
end
result = catch(:miracle_of_miracles) do
rich_tevye.live
end
begin
do_something_error_prone
rescue AParticularKindOfError
# Insert heroism here.
rescue Exception
write_to_error_log
raise
end
catch :foo do
catch :bar do
do_something_that_can_throw_foo_or_bar
end
end
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang='en-US' xml:lang='en-US' xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>
passwordComplexity jQuery plugin demo
</title>
<style type='text/css'>
* {
font-family: Helvetica, Arial, sans-serif;
var mintonsPlayhouseCirca1941 = new Nightclub();
mintonsPlayhouseCirca1941.Bouncer = delegate(person)
{
// Welcome, paying customers!
var customer = person as ICustomer;
if ((customer != null) && (customer.CashOnHand > 0)) return true;
// Feel free to sit in ... if you can play, that is.
var musician = person as IMusician;
if ((musician != null) &&
using System;
using System.Collections.Generic;
class Nightclub
{
private readonly List<Person> occupants = new List<Person>();
public Nightclub()
{
occupants = new List<Person>();