Skip to content

Instantly share code, notes, and snippets.

John E. Vincent lusis

Block or report user

Report or block lusis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:433050
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
View gist:433057
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
View gist:433060
define host {
use linux-server
host_name oio
alias oio
address oio.mydomain.int
hostgroups webs
}
View rsplit.rb
class String
def rsplit(delim,count)
self.reverse.split(delim, count).map(&:reverse).reverse
end
end
View gist:439590
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.
View riak ripple + padrinorb
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
View gist:457058
<h1>Examples</h1>
<% @examples.each do |example| %>
<p><%= example.language.name %>
<p><%= example.api.name %>
<p><%= example.code %>
<p><%= example.created_at %>
<% end %>
View gist:458967
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
View gist:458969
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
View gist:458979
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
You can’t perform that action at this time.