Skip to content

Instantly share code, notes, and snippets.

View lusis's full-sized avatar

John E. Vincent lusis

View GitHub Profile
objfile.each_line do |line|
if line =~ /^define/
def_start, obj_type, open_brace = line.split
next
end
unless line =~ /\}/
obj_param, obj_val =- line.split(nil,2)
# Do something
end
end
4:
- name: us-holidays
- timeperiod_name: us-holidays
- alias: U.S. Holidays
- january: 1 00:00-00:00
- monday: -1 may 00:00-00:00
- july: 4 00:00-00:00
- monday: 1 september 00:00-00:00
- thursday: -1 november 00:00-00:00
- december: 25 00:00-00:00
define host {
use linux-server
host_name oio
alias oio
address oio.mydomain.int
hostgroups webs
}
class String
def rsplit(delim,count)
self.reverse.split(delim, count).map(&:reverse).reverse
end
end
No compatible versions could be found for required dependencies:
Conflict on: "i18n":
* i18n (0.4.1) activated by padrino (= 0.9.10, runtime)
* i18n (~> 0.3.6, runtime) required by activesupport (>= 3.0.0beta3, runtime)
All possible versions of origin requirements conflict. Conflict on: "activesupport":
* activesupport (3.0.pre) activated by activesupport (>= 3.0.0beta3, runtime)
* activesupport (= 3.0.0.beta3, runtime) required by ripple (= 0.7.1, runtime)
All possible versions of origin requirements conflict.
jvincent@jvx64:~/Dropbox/test/padtest$ padrino-gen model Client name:string phone:string email:string
=> Located unlocked Gemfile for development
apply orms/ripple
create app/models/client.rb
jvincent@jvx64:~/Dropbox/test/padtest$ padrino console
=> Loading development console (Padrino v.0.9.13)
=> Located unlocked Gemfile for development
=> Loading Application Padtest
Couldn't load Wirble: no such file to load -- interactive_editor
ree-1.8.7-2010.02 > myclient = Client.new
<h1>Examples</h1>
<% @examples.each do |example| %>
<p><%= example.language.name %>
<p><%= example.api.name %>
<p><%= example.code %>
<p><%= example.created_at %>
<% end %>
class Tester
include DataMapper::Resource
property :id, Serial
property :name, String, :required => true, :length => 75
property :email, String, :required => true, :length => 75, :unique_index => true
property :comments, Text
property :created_at, DateTime
has n, :skills
CREATE TABLE `testers` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(75) NOT NULL,
`email` varchar(75) NOT NULL,
`comments` text,
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_testers_email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
require 'rubygems'
require 'dm-core'
require 'dm-migrations'
require 'dm-timestamps'
DataMapper::Logger.new($stdout, :debug)
DataMapper.setup(:default, "mysql://root@localhost/db_development")
class Tester
include DataMapper::Resource