$ rails g model User
belongs_to
has_one
| #!/bin/sh | |
| gnome-terminal \ | |
| --tab -t "guard" --working-directory=$HOME/projects/my_project \ | |
| --tab -t "server" --working-directory=$HOME/projects/my_project \ | |
| --tab -t "console" --working-directory=$HOME/projects/my_project \ | |
| --tab -t "cli" --working-directory=$HOME/projects/my_project \ | |
| --tab -t "root" --profile=root |
| #!/usr/bin/env ruby | |
| # Put this file in /script/ directory. | |
| require 'rails/commands/server' | |
| Rails::Server.new.tap { |server| | |
| APP_PATH = File.expand_path('../../config/application', __FILE__) | |
| require APP_PATH | |
| Dir.chdir(Rails.application.root) | |
| server.start |
| CREATE TABLE test ( | |
| id INT NOT NULL AUTO_INCREMENT, | |
| last_name VARCHAR(255) NOT NULL, | |
| first_name VARCHAR(255) NOT NULL, | |
| PRIMARY KEY (id) | |
| ); | |
| drop procedure prepare_data; | |
| delete from test where id>0; |
| #!/usr/bin/env bash | |
| # Tested for Ubuntu 12.04 | |
| [[ "$(id -u)" -ne "0" ]] && echo "must be root!" && exit 1 | |
| RBVER="1.9.3-p194" | |
| apt-get update | |
| apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev wget rsync |
| diff --git a/gc.c b/gc.c | |
| --- a/gc.c | |
| +++ b/gc.c | |
| @@ -77,6 +77,41 @@ void *alloca (); | |
| #ifndef GC_MALLOC_LIMIT | |
| #define GC_MALLOC_LIMIT 8000000 | |
| #endif | |
| +#define HEAP_MIN_SLOTS 10000 | |
| +#define FREE_MIN 4096 | |
| + |
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
| gemname = ARGF.argv[0] | |
| spec = Gem::Specification.find_by_name(gemname) | |
| gem_root = spec.gem_dir | |
| gem_lib = gem_root + "/lib" | |
| puts gem_lib |
| #!/usr/bin/env ruby | |
| # | |
| # In order to run: | |
| # > ruby server.rb | |
| # | |
| # Or add execution permissions and run: | |
| # > ./server.rb | |
| # | |
| # Then point your browser to http://localhost:1234/your_file.html |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
| <title>Search</title> | |
| <style> | |
| body { margin: 0; box-sizing: border-box; } | |
| .header { width: 100%; height: 36px; background: #DAE3ED; padding: 14px; color: #111; } | |
| .search { margin: 0 40px; } | |
| .search__input { height: 26px; width: 40%; border-radius: 4px; padding: 4px 8px; |