Skip to content

Instantly share code, notes, and snippets.

@atsheehan
atsheehan / server.rb
Created May 30, 2014 14:43
Using session persistence with Sinatra.
require 'sinatra'
# Be sure to set an environment variable containing your secret key.
# This will be used to encrypt the cookies that are sent to the client.
#
# $ export SECRET_TOKEN=super_secret_key_goes_here
use Rack::Session::Cookie, secret: ENV['SECRET_TOKEN']
get '/' do

Tech Interview Questions

Linked List

Implement a linked list in Ruby

class Node
  def initialize(data)
 @data = data