This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| unless File.exists?('Gemfile') | |
| File.write('Gemfile', <<-GEMFILE) | |
| source 'https://rubygems.org' | |
| gem 'rails', github: 'rails/rails' | |
| gem 'sqlite3' | |
| gem 'activerecord_any_of' | |
| gem 'pry' | |
| gem 'pg' | |
| GEMFILE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'yaml' | |
| # original idea comes from http://darwinweb.net/articles/convert-syck-to-psych-yaml-format | |
| namespace :encoding do | |
| desc 'convert serialized Content data from syck yaml serializations to psych' | |
| task :psych => :environment do | |
| content_id = ENV['content_id'] | |
| if content_id | |
| convert_data Content.find(content_id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| unless File.exists?('Gemfile') | |
| File.write('Gemfile', <<-GEMFILE) | |
| source 'https://rubygems.org' | |
| gem 'rails', github: 'rails/rails' | |
| gem 'sqlite3' | |
| GEMFILE | |
| system 'bundle' | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Pod::Spec.new do |s| | |
| s.name = "ReactiveCocoa" | |
| s.version = "1.9.6" | |
| s.summary = "A framework for composing and transforming sequences of values." | |
| s.homepage = "https://github.com/blog/1107-reactivecocoa-is-now-open-source" | |
| s.author = { "Josh Abernathy" => "josh@github.com" } | |
| s.source = { :git => "https://github.com/ReactiveCocoa/ReactiveCocoa.git", :tag => "v#{s.version}" } | |
| s.license = 'Simplified BSD License' | |
| s.description = "ReactiveCocoa offers:\n" \ | |
| "1. The ability to compose operations on future data.\n" \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class User < ActiveRecord::Base | |
| rolify :after_add => :event_added_mew_role #, :role_cname => 'Role' | |
| accepts_nested_attributes_for :roles | |
| attr_accessible :roles_attributes | |
| # Include default devise modules. Others available are: | |
| # :confirmable, | |
| # :lockable, :timeoutable and :omniauthable | |
| devise :database_authenticatable, :registerable, :token_authenticatable, | |
| :recoverable, :rememberable, :trackable, :validatable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| class Palindrome | |
| return string if string.length == 1 | |
| l = "" | |
| string.size.times do |i| | |
| break if string.size - i <= l.size | |
| c = -1 | |
| while (a = string.rindex(string[i], c)) != i || a - i > l.size do | |
| b = string[i..a] |
NewerOlder