This file contains 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 'ostruct' | |
class OpenStruct | |
def self_and_field_pairs | |
each_pair.map { |field, _| [self, field] } | |
end | |
end | |
class Hash | |
# Converts a hash to an OpenStruct along with all its nested hashes. The hash |
This file contains 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
# Eliminate asset, template and test fluff. Shut down asset generation, ERB | |
# templates, as well as tests and their fixtures. | |
config.generators do |g| | |
g.assets false | |
g.template_engine false | |
g.test_framework false | |
end |
This file contains 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
# The production database uses a non-default user name for PostgreSQL | |
# connections. The user name corresponds to the app name. Use this Rake task to | |
# create the corresponding PostgreSQL role. | |
namespace :pg do | |
namespace :role do | |
task :create => :environment do | |
ActiveRecord::Base.configurations.select { |env, config| | |
config['adapter'] == 'postgresql' | |
}.collect { |env, config| | |
config['username'] |
This file contains 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
// XCTest XCTestCase+NSBundle.swift | |
// | |
// Copyright © 2015, Roy Ratcliffe, Pioneering Software, United Kingdom | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the “Software”), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
This file contains 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
// PS UIViewController+PS.swift | |
// | |
// Copyright © 2015, Roy Ratcliffe, Pioneering Software, United Kingdom | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the “Software”), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
This file contains 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
// UITableView TableViewData.h | |
// | |
// Copyright © 2015, Roy Ratcliffe, Pioneering Software, United Kingdom | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the “Software”), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
This file contains 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
// Foundation NSObject+Properties.h | |
// | |
// Copyright © 2015, Roy Ratcliffe, Pioneering Software, United Kingdom | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the “Software”), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
This file contains 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
// Foundation NSObject+ObjCProperties.h | |
// | |
// Copyright © 2015, Roy Ratcliffe, Pioneering Software, United Kingdom | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the “Software”), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
This file contains 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
namespace :heroku do | |
desc "Push current branch to Heroku master" | |
task :push do | |
current_git_branch = %x(git branch).split("\n").select { |line| line =~ /^\* / }.map { |line| line[2..-1] }[0] | |
puts "Pushing branch #{current_git_branch} to Heroku" | |
%x(git push heroku #{current_git_branch}:master) | |
end | |
end |
OlderNewer