http://ruby-china.org/topics/16256
get https://github.com/mvj3/hangman/blob/master/data/words.txt
and compile the decision tree.json
ruby compile.rb
http://ruby-china.org/topics/16256
get https://github.com/mvj3/hangman/blob/master/data/words.txt
and compile the decision tree.json
ruby compile.rb
require 'date' | |
author = "Saito" | |
email = "saitowu@gmail.com" | |
date = Date.new(2012, 7, 30) | |
s = %w{ | |
. . . . . . . | |
. . o o o . . | |
. o . . . . . |
namespace :deploy do | |
desc "重启服务器" | |
task :restart, :roles => :app do | |
run "touch #{current_path}/tmp/restart.txt" | |
end | |
desc "在本地生成配置文件" | |
task :setup_local_configs do |
#! /usr/bin/perl -w | |
use strict; | |
my $since; | |
if ($ARGV[0]) { | |
$since = $ARGV[0]; | |
} else { | |
$since = "1 week ago"; | |
} |
This list has been superseded by Public APIs. Check there for APIs with Auth: No
, HTTPS
and CORS
Yes
.
List of data APIs that require no server-side auth or private credentials, and are thus good for small browser-only JS projects.
the default index.html does not work well in prodution mode, so do not borther to config that, just delete it and go on.
To put things in production mode, do
rails g scaffold items name:string
rake db:migrate RAILS_ENV=production
rm public/index.html
#change route.rb point root to items#index
rake assets:precompile
sudo service nginx restart
./config/unicorn_init.sh stop
#Behold, the nav_link:
The nav_link helper works just like the standard Rails link_to helper, but adds a 'selected' class to your link (or its wrapper) if certain criteria are met. By default, if the link's destination url is the same url as the url of the current page, a default class of 'selected' is added to the link.
For full usage details, see: http://viget.com/extend/rails-selected-nav-link-helper
Drop nav_link_helper.rb into app/helpers in your Rails 3.x app and enjoy.