Here's my usage of the HTML5 canvas tag. Tested using FF3.5 on OSX 10.5.7.
Demo
Source
Saturday, July 11, 2009
Sunday, June 7, 2009
Arduino TouchShield Asteroids
Asteroids-like asteroids on the Arduino Diecimila and TouchShield Stealth. Creates several asteroids that float around the screen.
Code at http://github.com/clindsey/arduino-touchshield-asteroids.
Code at http://github.com/clindsey/arduino-touchshield-asteroids.
Saturday, June 6, 2009
Arduino TouchShield Nunchuck Pong
A simple pong game using an Arduino Diecimila, TouchShield Stealth and Wii nunchuck
Code at http://github.com/clindsey/arduino-nunchuck-pong.
Code at http://github.com/clindsey/arduino-nunchuck-pong.
Thursday, June 4, 2009
Arduino, Nunchuck, Servos
Wii nunchuck remote hooked up to Arduino Diecimila controlling two servos.
The nunchuck's accelerometers control the servos unless the Z button is held down, then the joystick is in control.
Code at http://github.com/clindsey/arduino-nunchuck-servos.
The servos came from a remote controlled helicopter that I couldn't fly.
Thanks to Chad Phillips' arduino-nunchuck code at http://www.windmeadow.com/node/42.
The nunchuck's accelerometers control the servos unless the Z button is held down, then the joystick is in control.
Code at http://github.com/clindsey/arduino-nunchuck-servos.
The servos came from a remote controlled helicopter that I couldn't fly.
Thanks to Chad Phillips' arduino-nunchuck code at http://www.windmeadow.com/node/42.
Monday, April 6, 2009
Ubuntu 8.10 Server Setup Cheat Sheet
Ubuntu 8.10 Server Setup Cheat Sheet
Setting up a local development server with Ubuntu 8.10, a wireless internet connection, OpenSSH Server, Ruby on Rails, Thin, Nginx, Git and PostgreSQL.
Index
- Hardware Used
- Download Ubuntu
- New Server Setup Procedure
- Connect to a Wifi Router
- Install an SSH Server
- Enable Aptitude Sources
- Update Aptitude Sources
- Check For Upgrades
- Install Build Essential Packages
- Install Ruby
- Install RubyGems
- Install Rails
- Install Git
- Install Thin, a Ruby Web Server
- Install Nginx Web Server
- Configuire Nginx Virtual Host for Thin
- Install PostgreSQL
- Ruby & Postgres
- Serve Git Repositories
Hardware Used
- Notebook Computer as Server, a Sony Vaio VGN-SZ110, IP 192.168.1.72
- Notebook Computer as admin's terminal, an Apple MacBookPro with OSX 10.5
- Wireless Router, SSID of '2WIRE739', WEP hex key 0011223344
Download Ubuntu
- 8.10 Intrepid, Server edition at http://www.ubuntu.com/getubuntu/download
New Server Setup Procedure
- Install Ubuntu OS onto computer, generic setup procedure, excepting skip DHCP setup (this guide will not go into detail)
- Get connected to the internet through the wifi router
- Enable SSH server for remote administration
- Update and upgrade the system, install essentials
- Install Ruby, RubyGems and Rails
- Install Git version control
- Install and configure Nginx and thin
- Install PostgreSQL
- Install PostgreSQL support for Ruby
Connect to a Wifi Router
- "sudo dhclient wlan0"
- "sudo iwlist wlan0"
- take note of the connection data for 2WIRE739, it's many coloned number
- "sudo iwconfig wlan0 essid 2WIRE739"
- "sudo iwconfig wlan0 key 0011223344"
- "sudo iwconfig wlan0 00:00:00:00:00"
- "sudo dhclient wlan0"
- that should have you connected, my IP was made 192.168.1.72
Source
Install an SSH Server
- "sudo apt-get install openssh-server"
- test this with "ssh localhost"
Enable Aptitude Sources
- "sudo nano etc/apt/sources.list"
- uncomment the appropriate sources, I used them all
Source
Update Aptitude Sources
- "sudo aptitude update"
Source
Check for Upgrades
- "sudo aptitude safe-upgrade"
- "sudo aptitude full_upgrade"
Source
Install Build Essential Packages
- "sudo aptitude install build-essential"
Source
Install Ruby
- "sudo aptitude install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8 libreadline-ruby1.8 libruby1.8 libopenssl-ruby sqlite3 libsqlite3-ruby1.8"
- "sudo ln -s /usr/bin/ruby1.8 /usr/bin/ruby"
- "sudo ln -s /usr/bin/ri1.8 /usr/bin/ri"
- "sudo ln -s /usr/bin/rdoc1.8 /usr/bin/rdoc"
- "sudo ln -s /usr/bin/irb1.8 /usr/bin/irb"
Source
Install RubyGems
- "mkdir ~/sources"
- "cd ~/sources"
- "wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz"
- "tar xzvf rubygems-1.3.1.tgz"
- "cd rubygems-1.3.1"
- "sudo ruby setup.rb"
- "sudo ln -s /usr/bin/gem1.8 /usr/bin/gem"
- "sudo gem update"
- "sudo gem update --system"
Source
Install Rails
- "sudo gem install rails"
Source
Install Git
- "sudo apt-get install git-core"
- "git config --global user.name 'Your Name'"
- "git config --global user.email your_email@domain.com"
Install Thin, a Ruby Web Server
- "sudo gem install thin"
- "sudo thin install"
- "sudo /usr/sbin/update-rc.d -f thin defaults"
- "thin start -d" from rails app root
Source
Install Nginx Web Server
- "sudo aptitude install nginx"
- "sudo /etc/init.d/nginx start|stop|restart"
Source
Configure Nginx Virtual Host for Thin
- "cd ~/public_html"
- "rails railsapp"
- "cd railsapp"
- "sudo thin config -C /etc/thin/railsapp.yml -c /home/demo/public_html/railsapp/ --servers 3 -e production"
- "sudo /etc/init.d/thin start"
- "sudo nano /etc/nginx/sites-available/domain.com"
- "sudo /etc/init.d/nginx stop"
- "sudo /etc/init.d/nginx start"
- To visit from your terminal, add '192.168.1.72 domain.com' to '/private/etc/hosts' file and direct browser to 'domain.com'
Source
Install PostgreSQL
- "sudo aptitude install postgresql-8.3"
- "sudo su postgres -c psql template1"
- "template1=#ALTER USER postgres WITH PASSWORD 'password'
- "template1=#\q"
- "sudo passwd -d postgres"
- "sudo -u postgres passwd"
- use same password as ALTER USER statement above
- "sudo nano /etc/postgresql/8.3/main/pg_hba.conf"
- replace "local all all ident sameuser" with "local all all md5"
- "sudo /etc/init.d/postgresql-8.3 restart"
- "sudo -u postgres createuser -d -R -P username"
- create a user to access database
- "sudo -u postgres createdb -O username database_name"
- create a database for a user
Ruby & Postgres
- "sudo aptitude install libpgsql-ruby1.8"
Serve Git Repositories
- create a new user, 'git', to host the repositories
- "sudo adduser git"
- login as git and create a repository in home directory
- "ssh git@192.168.1.72"
- "mkdir railsapp.git"
- "cd railsapp.git"
- "git --bare init"
- on development machine, to upload to server
- "cd /path/to/railsapp"
- "git remote add origin git@192.168.1.72:railsapp.git"
- "git push origin master"
Source
Setting up a local development server with Ubuntu 8.10, a wireless internet connection, OpenSSH Server, Ruby on Rails, Thin, Nginx, Git and PostgreSQL.
Index
- Hardware Used
- Download Ubuntu
- New Server Setup Procedure
- Connect to a Wifi Router
- Install an SSH Server
- Enable Aptitude Sources
- Update Aptitude Sources
- Check For Upgrades
- Install Build Essential Packages
- Install Ruby
- Install RubyGems
- Install Rails
- Install Git
- Install Thin, a Ruby Web Server
- Install Nginx Web Server
- Configuire Nginx Virtual Host for Thin
- Install PostgreSQL
- Ruby & Postgres
- Serve Git Repositories
Hardware Used
- Notebook Computer as Server, a Sony Vaio VGN-SZ110, IP 192.168.1.72
- Notebook Computer as admin's terminal, an Apple MacBookPro with OSX 10.5
- Wireless Router, SSID of '2WIRE739', WEP hex key 0011223344
Download Ubuntu
- 8.10 Intrepid, Server edition at http://www.ubuntu.com/getubuntu/download
New Server Setup Procedure
- Install Ubuntu OS onto computer, generic setup procedure, excepting skip DHCP setup (this guide will not go into detail)
- Get connected to the internet through the wifi router
- Enable SSH server for remote administration
- Update and upgrade the system, install essentials
- Install Ruby, RubyGems and Rails
- Install Git version control
- Install and configure Nginx and thin
- Install PostgreSQL
- Install PostgreSQL support for Ruby
Connect to a Wifi Router
- "sudo dhclient wlan0"
- "sudo iwlist wlan0"
- take note of the connection data for 2WIRE739, it's many coloned number
- "sudo iwconfig wlan0 essid 2WIRE739"
- "sudo iwconfig wlan0 key 0011223344"
- "sudo iwconfig wlan0 00:00:00:00:00"
- "sudo dhclient wlan0"
- that should have you connected, my IP was made 192.168.1.72
Source
Install an SSH Server
- "sudo apt-get install openssh-server"
- test this with "ssh localhost"
Enable Aptitude Sources
- "sudo nano etc/apt/sources.list"
- uncomment the appropriate sources, I used them all
Source
Update Aptitude Sources
- "sudo aptitude update"
Source
Check for Upgrades
- "sudo aptitude safe-upgrade"
- "sudo aptitude full_upgrade"
Source
Install Build Essential Packages
- "sudo aptitude install build-essential"
Source
Install Ruby
- "sudo aptitude install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8 libreadline-ruby1.8 libruby1.8 libopenssl-ruby sqlite3 libsqlite3-ruby1.8"
- "sudo ln -s /usr/bin/ruby1.8 /usr/bin/ruby"
- "sudo ln -s /usr/bin/ri1.8 /usr/bin/ri"
- "sudo ln -s /usr/bin/rdoc1.8 /usr/bin/rdoc"
- "sudo ln -s /usr/bin/irb1.8 /usr/bin/irb"
Source
Install RubyGems
- "mkdir ~/sources"
- "cd ~/sources"
- "wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz"
- "tar xzvf rubygems-1.3.1.tgz"
- "cd rubygems-1.3.1"
- "sudo ruby setup.rb"
- "sudo ln -s /usr/bin/gem1.8 /usr/bin/gem"
- "sudo gem update"
- "sudo gem update --system"
Source
Install Rails
- "sudo gem install rails"
Source
Install Git
- "sudo apt-get install git-core"
- "git config --global user.name 'Your Name'"
- "git config --global user.email your_email@domain.com"
Install Thin, a Ruby Web Server
- "sudo gem install thin"
- "sudo thin install"
- "sudo /usr/sbin/update-rc.d -f thin defaults"
- "thin start -d" from rails app root
Source
Install Nginx Web Server
- "sudo aptitude install nginx"
- "sudo /etc/init.d/nginx start|stop|restart"
Source
Configure Nginx Virtual Host for Thin
- "cd ~/public_html"
- "rails railsapp"
- "cd railsapp"
- "sudo thin config -C /etc/thin/railsapp.yml -c /home/demo/public_html/railsapp/ --servers 3 -e production"
- "sudo /etc/init.d/thin start"
- "sudo nano /etc/nginx/sites-available/domain.com"
upstream domain1 {
server 127.0.0.1:3000;
server 127.0.0.1:3001;
server 127.0.0.1:3002;
}
server {
listen 80;
server_name www.domain.com;
rewrite ^/(.*) http://domain.com/$1 permanent;
}
server {
listen 80;
server_name domain.com;
access_log /home/demo/public_html/railsapp/log/access.log;
error_log /home/demo/public_html/railsapp/log/error.log;
root /home/demo/public_html/railsapp/public/;
index index.html;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect false;
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
if (-f $request_filename.html) {
rewrite (.*) $1.html break;
}
if (!-f $request_filename) {
proxy_pass http://domain1;
break;
}
}
}- "sudo ln -s /etc/nginx/sites-available/domain.com /etc/nginx/sites-enabled/domain.com"- "sudo /etc/init.d/nginx stop"
- "sudo /etc/init.d/nginx start"
- To visit from your terminal, add '192.168.1.72 domain.com' to '/private/etc/hosts' file and direct browser to 'domain.com'
Source
Install PostgreSQL
- "sudo aptitude install postgresql-8.3"
- "sudo su postgres -c psql template1"
- "template1=#ALTER USER postgres WITH PASSWORD 'password'
- "template1=#\q"
- "sudo passwd -d postgres"
- "sudo -u postgres passwd"
- use same password as ALTER USER statement above
- "sudo nano /etc/postgresql/8.3/main/pg_hba.conf"
- replace "local all all ident sameuser" with "local all all md5"
- "sudo /etc/init.d/postgresql-8.3 restart"
- "sudo -u postgres createuser -d -R -P username"
- create a user to access database
- "sudo -u postgres createdb -O username database_name"
- create a database for a user
Ruby & Postgres
- "sudo aptitude install libpgsql-ruby1.8"
Serve Git Repositories
- create a new user, 'git', to host the repositories
- "sudo adduser git"
- login as git and create a repository in home directory
- "ssh git@192.168.1.72"
- "mkdir railsapp.git"
- "cd railsapp.git"
- "git --bare init"
- on development machine, to upload to server
- "cd /path/to/railsapp"
- "git remote add origin git@192.168.1.72:railsapp.git"
- "git push origin master"
Source
Saturday, October 4, 2008
JavaScript Isometric Game Engine
Here's an example of an isometric tile environment with depth sorting and path finding, in javascript.
It's only been tested to work with FireFox 3. IE6 has issues with the PNG transparency. Safari may render the field, but not have any interactivity.
The code is available at GitHub.
It's only been tested to work with FireFox 3. IE6 has issues with the PNG transparency. Safari may render the field, but not have any interactivity.
The code is available at GitHub.
Thursday, September 4, 2008
rSpec super: no superclass method `respond_to?'
Using ZenTest's autotest for rSpec kept giving me weird errors,
The test failure info said that the issues was coming from one of my model tests, but restarting autotest temporarily fixed the issue.
I had a 'script/console development' session open at another terminal, I closed it and the issue went away.
super: no superclass method `respond_to?'
The test failure info said that the issues was coming from one of my model tests, but restarting autotest temporarily fixed the issue.
I had a 'script/console development' session open at another terminal, I closed it and the issue went away.
Labels:
rails,
rspec,
ruby,
super: no superclass method `respond_to?',
testing
Subscribe to:
Posts (Atom)
