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 'active_model/validator' | |
# Runs [Array] type validations | |
class ArrayValidator < ActiveModel::EachValidator | |
# Checks if the value is an [Array] type | |
# | |
# Will sort, remove duplicates and blanks as well. | |
# | |
# Will validate the subset if passed options are present under `subset_of`. | |
# |
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 "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
gem "activerecord", "~> 4" | |
gem "pg", "0.19" | |
end | |
require "active_record" |
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 :rails do | |
desc 'Opens the Rails console' | |
task :console => ['deploy:set_rails_env'] do | |
on primary fetch(:migration_role) do | |
within release_path do | |
with rails_env: fetch(:rails_env) do | |
cmd_string = command(:rails, 'console').to_command | |
exec 'ssh %s -l %s -p %s -t "%s"' % [ | |
host.hostname, host.username, host.port, cmd_string] | |
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
require 'mina/bundler' | |
require 'mina/rails' | |
require 'mina/git' | |
require 'mina/rbenv' # for rbenv support. (http://rbenv.org) | |
# require 'mina/rvm' # for rvm support. (http://rvm.io) | |
# Basic settings: | |
# domain - The hostname to SSH to. | |
# deploy_to - Path to deploy into. | |
# repository - Git repo to clone from. (needed by mina/git) |
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
pry(#<RSpec::Core::ExampleGroup::Nested_14::Nested_1>)> @routes.router | |
=> #<Journey::Router:0xa4e6150 | |
@options= | |
{:parameters_key=>"action_dispatch.request.path_parameters", | |
:request_class=>ActionDispatch::Request}, | |
@params_key="action_dispatch.request.path_parameters", | |
@request_class=ActionDispatch::Request, | |
@routes= | |
#<Journey::Routes:0xa4e61b4 | |
@ast= |
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
#!/usr/bin/env rake | |
require 'rspec/core/rake_task' | |
RSpec::Core::RakeTask.new(:spec => :dummy_app) do |t| | |
t.pattern = File.expand_path('../spec/**/*_spec.rb', __FILE__) | |
end | |
task :default => :spec | |
desc 'Generates a dummy app for testing' | |
task :dummy_app => [:setup, :migrate] |
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
[core] | |
repositoryformatversion = 0 | |
filemode = true | |
bare = false | |
logallrefupdates = true | |
autocrlf = false | |
[remote "origin"] | |
fetch = +refs/heads/*:refs/remotes/origin/* | |
url = [email protected]:Courseware/buddypress-courseware.git | |
[branch "master"] |
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
<?php | |
/* | |
Plugin Name: Git Version | |
Plugin URI: http://wordpress.org/extend/plugins/git-version/ | |
Description: Add a git version meta to HEAD | |
Version: 0.1 | |
Author: sushkov | |
Author URI: http://wordpress.org/extend/plugins/git-version/ | |
*/ | |
?> |
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
diff --git vbseo/includes/functions_vbseo_pre.php vbseo/includes/functions_vbseo_pre.php | |
index db03f74..27a251f 100755 | |
--- vbseo/includes/functions_vbseo_pre.php | |
+++ vbseo/includes/functions_vbseo_pre.php | |
@@ -26,7 +26,7 @@ if (!defined('VBSEO_VB_EXT')) | |
define('VBSEO_VB_EXT', 'php'); | |
function vbseo_is_https() | |
{ | |
-return isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] != 'off') || isset($_SERVER['HTTP_FRONT_END_HTTPS']); | |
+return isset($_SERVER['HTTPS']) && ( !empty( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] != 'off') || isset($_SERVER['HTTP_FRONT_END_HTTPS']); |
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 'haml' | |
# Do not buffer output | |
$stdout.sync = true | |
# Get working dir, fixes issues when rackup is called outside app's dir | |
root_path = Dir.pwd | |
use Rack::Static, | |
:urls => ['/stylesheets', '/images', '/javascripts', '/fonts'], | |
:root => root_path |
NewerOlder