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
unless line =~ /\}/
obj_param, obj_val =- line.split(nil,2)
# Do something
View gist:433057
- 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
hostgroups webs
View rsplit.rb
class String
def rsplit(delim,count)
self.reverse.split(delim, count).map(&:reverse).reverse
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 =
View gist:457058
<% @examples.each do |example| %>
<p><%= %>
<p><%= %>
<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,
UNIQUE KEY `unique_testers_email` (`email`)
View gist:458979
require 'rubygems'
require 'dm-core'
require 'dm-migrations'
require 'dm-timestamps'$stdout, :debug)
DataMapper.setup(:default, "mysql://root@localhost/db_development")
class Tester
include DataMapper::Resource
You can’t perform that action at this time.