So you think you wanna be a web developer... Fork this, update your copy with answers. They don't need to be precise - pseudo-code is fine in most cases. Some questions don't have correct answers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sequel.migration do | |
up do | |
create_table :customers do | |
primary_key :id | |
column :name, :varchar, size:60, null:false | |
column :organization, :varchar, size:60, null:false | |
column :email, :varchar, size:60 | |
column :subscribed, :boolean, default:false, null:false | |
column :extra_str, :varchar, size:60 | |
column :extra_int, :integer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SERVER = 'druby://localhost:9123' | |
require 'drb' | |
server = DRbObject.new_with_uri(SERVER) | |
server.go(42) | |
sleep(0.2) | |
server.go(17) | |
server.join_all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define a method that takes a path to a file and returns an array of all words therein | |
def read_words( filename ) | |
# Read in the contents of the file and split it into | |
# an array of strings by finding (and discarding) any "whitespace" | |
# (spaces, tabs, newlines) | |
File.read(filename).split(/\s+/) | |
end | |
# Define a method that takes an array of words and returns an array without any 'junk' words | |
def remove_useless_words( all_words ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# /etc/init.d/minecraft | |
# version 0.3.4 2011-06-12 (YYYY-MM-DD) | |
### BEGIN INIT INFO | |
# Provides: minecraft | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Should-Start: $network | |
# Should-Stop: $network |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
#encoding: UTF-8 | |
require_relative 'server2' | |
class Laink::Client | |
attr_reader :name | |
def initialize | |
@server = nil | |
@name = "Client #{rand(10000).to_s(36)}" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Force-Directed Symbols</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.25.0"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?1.25.0"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?1.25.0"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local lua = [[{ | |
["hello"]="there\nworld", | |
["array"]={1,2,3,1e6,{["more"]=false},nil,true}, | |
["more"]={ | |
["hello"]="there\nworld", | |
["array"]={1,2,3,1e6,{["more"]=false},nil,true}, | |
["more"]={ | |
["hello"]="there\nworld", | |
["array"]={1,2,3,1e6,{["more"]=false},nil,true}, | |
["more"]={ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! 5 | |
%html | |
%head | |
%meta(charset="utf-8") | |
%title Page Title | |
%meta(name="author" content="") | |
%meta(name="description" content="") | |
%meta(name="revisit-after" content="3 days") | |
%link(href="http://creativecommons.org/licenses/by/4.0/" rel="license" title="Creative Commons Attribution License") | |
%link(href="/css/screen.css" media="screen" rel="stylesheet") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------+------------------------------------------------------------------------------- | |
-- ct | code ------------------------------------------------------------------------- | |
-------+------------------------------------------------------------------------------- | |
120 local LXSC = require 'lib/lxsc'; | |
*****0 (function(S) | |
120 S.MAX_ITERATIONS = 1000 | |
120 local OrderedSet,Queue,List = LXSC.OrderedSet, LXSC.Queue, LXSC.List | |
-- **************************************************************************** | |