-
mkdir config
touch config/environments.rb
- Set it up thusly:
I have found that the Javascript work we have done so far lends itself to encapsulate in logical steps. When starting new javascript work, here is the little cookbook/recipie I follow. Here are my thoughts using TicTacToe and PixArt as examples.
I am going to define the object as the game. So that I can say myGame = new TicTacToe();
My game needs a board. It needs players, but X always goes first. And the game is either won or unwon but when it starts, there is no winner. I think my game should have how many moves have been played (but this could also be figured out by inspecting the board).
The actions I will have are only two: make a move, and see if someone has won.
#!/bin/sh | |
mkdir app | |
cd app | |
mkdir public | |
mkdir views | |
touch server.rb | |
echo "require 'pry' \n require 'sinatra' \n \n get '/' do \n erb :index \n end \n" >> server.rb | |
cd public |
class LifeBoardArray < Array | |
def [](index) | |
if index<=3 | |
super(index) | |
elsif index > 3 | |
super(index%4) | |
else | |
raise IndexError | |
end |
#the fiddle class in ruby | |
#http://ruby-doc.org/stdlib-2.0.0/libdoc/fiddle/rdoc/Fiddle/Pointer.html#method-c-new | |
require 'fiddle' | |
require 'pry' | |
#this is a regular variable holding a string, aka a string object with the | |
#value "hello strange person" | |
my_string = "hello strange person!" | |
#this gets an integer pointing to location of your object in memmory. |
#The NYC DevShop 40 Step Server Deploy Guide Written by The DevShop Team
###1. Create A Droplet In A Digital Ocean
- Log in to Digital Ocean
- Enter hostname - this should be something useful to you, maybe your Appname?
- Select a 1gb / 1cpu Droplet
- Use Ubuntu 12.0.4
- Do not use ssh keys!
It's Easy!
-
Put this in your
application.rb
config.assets.paths << Rails.root.join('app', 'assets', 'fonts') config.assets.precompile += %w( .svg .eot .woff .ttf )
-
Reboot your server!
-
Create a
fonts.scss
file inassets/stylesheets
. -
Set up your font-face thusly. Pay extra attention to punctuation - everything must appear exactly as it does in the file system.
I hereby claim:
- I am nicholalexander on github.
- I am nicholalexander (https://keybase.io/nicholalexander) on keybase.
- I have a public key whose fingerprint is DA8A F0BB 0149 82CA 7928 6F29 6EA0 FEC6 9B6A 73D0
To claim this, I am signing this object:
<!doctype><html><head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Odyssey.js Torque</title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="icon" type="image/x-icon" href="http://cartodb.github.io/odyssey.js/sandbox/favicon.png"> | |
<link rel="icon" type="image/png" href="http://cartodb.github.io/odyssey.js/sandbox/favicon.png"> |