rails new my_app -T
source 'http://rubygems.org'
gem 'rails', '3.1.0'
gem 'sqlite3'
rails new my_app -T
source 'http://rubygems.org'
gem 'rails', '3.1.0'
gem 'sqlite3'
| curl https://raw.github.com/gist/1008945/4edd1e1dcc1f0db52d4816843a9d1e6b60661122/ruby-1.9.2p290.patch > /tmp/ruby-1.9.2p290.patch | |
| rvm install ruby-1.9.2-p290 --patch /tmp/ruby-1.9.2p290.patch |
| def convert_guid(short_guid) | |
| chunks = short_guid.chars.to_a | |
| char_map = %w{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5} | |
| extension = [] | |
| chunks.each_slice(5) { |x| y = x.reverse.map {|c| (c.match /[A-Z]/) ? 1 : 0 }.join("").to_i(2) ; extension << y} | |
| short_guid + (extension.map {|e| char_map.at(e)}).join("").to_s | |
| end |
| @isTest | |
| private class TestDemoWebCallout { | |
| static testMethod void testRestfulCallout() { | |
| Lead l = new Lead(); | |
| l.Status = 'Open'; | |
| l.LastName = 'Owen'; | |
| l.FirstName = 'Bob'; | |
| l.Street = '1234 Sesame Street'; | |
| l.City = 'Houston'; |
| # Prompt Setup | |
| YELLOW='\[\033[1;33m\]' | |
| BLUE='\[\033[1;34m\]' | |
| GREEN='\[\033[1;32m\]' | |
| RED='\[\033[0;31m\]' | |
| NORMAL='\[\033[00m\]' | |
| WHITE='\[\033[0;37m\]' | |
| function minutes_since_last_commit { |
| # | |
| # Initialize the stuff | |
| # | |
| # We build the status bar item menu | |
| def setupMenu | |
| menu = NSMenu.new | |
| menu.initWithTitle 'FooApp' | |
| mi = NSMenuItem.new | |
| mi.title = 'Hellow from MacRuby!' | |
| mi.action = 'sayHello:' |
| class PaddedTextFieldCell < NSTextFieldCell | |
| def drawingRectForBounds(cellFrame) | |
| super | |
| result = cellFrame | |
| padding_left = (result.size.width / 16).round # to make sure text is clear | |
| padding_top = (result.size.height / 4).round | |
| result.origin.x += padding_left | |
| result.origin.y += padding_top |
| # | |
| # Datastore.rb | |
| # A singleton class to manage a MacRuby application's data storage requirements. | |
| # | |
| # Chris Powell, cpowell@prylis.com, http://cbpowell.wordpress.com | |
| # | |
| # This work is licensed under a Creative Commons Attribution 3.0 Unported License. | |
| # http://creativecommons.org/licenses/by/3.0/ | |
| # | |
| # For usage and discussion, see http://cbpowell.wordpress.com/category/macruby/ |
| #!/usr/bin/ruby | |
| #Title :Ragios (aka St. Ruby) | |
| #Date :10/13/2010 | |
| #Author :Obi Akubue | |
| #Version :0.3.3 | |
| #description: This is the framework for a Ruby Based System and Network Monitoring Tool | |
| #this project is just an excuse to play with ruby and linux servers | |
| require 'net/http' |
| <div class="dataTables_processing" style="visibility: visible; "><img src="/assets/ajax-loader.gif"></div> |