This file contains 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 lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Test</title> | |
</head> | |
<body> | |
... | |
<script src="test.js"></script> | |
</body> |
This file contains 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
(function(global) { | |
if (typeof java !== "undefined") { | |
this.console = { log: function(s) { println(s); } } | |
// Download from https://raw.github.com/micmath/Rhino-Require/master/src/require.js | |
load("require.js"); | |
} | |
}(this)); | |
// Call console.log() and require() as usual |
This file contains 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
<% if (typeof message !== "undefined") { %> | |
<%= message %> | |
<% } %> | |
<form method="POST"> | |
State: | |
<input type=text name="state" | |
value="<%= state %>" size=2 maxlength=2> | |
<input type="submit"> | |
</form> |
This file contains 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
<% if (typeof message !== "undefined") { %> | |
<%= message %> | |
<% } %> | |
<form method="POST"> | |
State: | |
<input type=text name="state" | |
<% if (typeof state !== "undefined") { %> | |
value="<%= state %>" | |
<% } %> | |
size="2" maxlength="2"> |
This file contains 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
message: This is a message defined in the configuration file config.yaml | |
messageRepetitions: 3 | |
database: | |
driverClass: org.hsqldb.jdbc.JDBCDriver | |
user: cpsc476 | |
password: Passw0rd | |
url: jdbc:hsqldb:hsql://localhost/cpsc476;ifexists=true |
This file contains 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
/* genlogs.c - Generate fake log entries to stdout */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <unistd.h> | |
#define DATE_MAX_CHARS 25 | |
#define SIZE(a) (sizeof(a) / sizeof(*(a))) |
This file contains 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 | |
require 'sinatra' | |
require 'redis' | |
require 'enumerator' | |
configure do | |
REDIS = Redis.new | |
REDIS.setnx 'next', 10 * 36 ** 3 | |
end |
This file contains 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 | |
require 'sinatra' | |
require 'redis' | |
configure do | |
REDIS = Redis.new | |
end | |
get '/' do |
This file contains 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>Hello</title> | |
</head> | |
<body> | |
<h1>Hi, tell us a little about yourself</h1> | |
<form method="POST" action="/response"> | |
<p> | |
Name: <input type="text" name="name" /> |
This file contains 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
$ rvm use 1.9.2@railstutorial | |
$ rails new movies | |
$ cd movies | |
$ bundle install --local | |
$ rails generate scaffold Movie title:string rated:string | |
$ rails generate scaffold Category name:string | |
$ rails generate migration create_categories_movies | |
db/migrate/*_create_categories_movies.rb: |
OlderNewer