if you don't have macruby and hotcocoa already:
rvm use macruby
gem i hotcocoa
ok then you can run:
hotcocoa webviewbasic
| %script{ type: "text/javascript" } | |
| :plain | |
| $(function(){ | |
| var query = "ubuntu" | |
| var element = "#thorrents" | |
| var limit = 5 | |
| // TODO: jquery function - $("element").thorrents() | |
| var domain = "thorrents.com" | |
| var url = 'http://'+domain+'/search/'+query+'?callback=?' |
| <html><body> | |
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> | |
| <script type='text/javascript'> | |
| $(function(){ | |
| var query = "ubuntu" | |
| var element = "#thorrents" | |
| var limit = 5 | |
| // TODO: jquery function - $("element").thorrents() | |
| var domain = "thorrents.com" |
| #!/usr/bin/env ruby | |
| # Deletes a line from a file - unix semicolun notation - file:line | |
| # Usage: | |
| # | |
| path, line_number = ARGV[0].split(":") | |
| file = "" | |
| File.open(path).readlines.each_with_index do |line, idx| |
| # ruby hash representation improvement (or fix) | |
| ruby-1.9.2-head :001 > {a: "b"} | |
| => {:a=>"b"} | |
| ruby-1.9.2-head :002 > {a: "b"}.to_s | |
| => "{:a=>\"b\"}" | |
| should become: | |
| ruby-1.9.2-head :001 > {a: "b"} |
| require 'appscript' # gem i rb-appscript | |
| include Appscript | |
| command = "ls" | |
| app('Terminal').activate() | |
| app("System Events").application_processes["Terminal.app"].keystroke("t", :using => :command_down) | |
| tab = app('Terminal').windows[1].tabs.last.get | |
| app('Terminal').do_script(command, :in => tab) |
| http://uploads.makevoid.com/jquery_dom_highlighter.html |
| function editor() { # randomly chooses an editor for you :) | |
| [[ `expr $RANDOM % 2` == 0 ]] && editor="vim" || editor="mate" | |
| $editor $1 | |
| } |
| source 'http://rubygems.org' | |
| gem 'activesupport', :require => 'active_support' | |
| gem 'actionpack', :require => 'action_pack' | |
| gem 'actionmailer', :require => 'action_mailer' | |
| gem 'railties', :require => 'rails' | |
| gem 'mysql2' | |
| DM_VERSION = '~> 1.2.0.rc1' |
| require 'active_record' # or older require "activerecord" | |
| require_relative 'app/models/your_model' | |
| ActiveRecord::Base.establish_connection(adapter: 'mysql', host: 'localhost', username: 'root', database: 'your_database') | |
| describe "something" do | |
| it "should spec somehting" do | |
| YourModel.first.should be_a(YourModel) | |
| end | |
| end |