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
// Place your settings in this file to overwrite the default settings | |
{ | |
"files.autoSave": "onFocusChange", | |
"search.useIgnoreFiles": true, | |
"search.exclude": { | |
"**/node_modules": true, | |
"**/bower_components": true, | |
"test/vcr_cassettes": true, | |
}, | |
"git.enabled": false, |
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
# frozen_string_literal: true | |
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do |
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 'parser/current' | |
require 'byebug' | |
class FixDefTest < Parser::Rewriter | |
def on_def(node) | |
name, args_node, body_node = *node | |
if name.to_s.start_with?("test_") | |
replace(node.location.keyword, "test") | |
replace(node.location.name, %("#{name.to_s.gsub(/^test_/, "").gsub("_", " ")}" do)) | |
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 'parser/current' | |
require 'byebug' | |
class FixGets < Parser::Rewriter | |
def on_send(node) | |
receiver_node, method_name, *args = *node | |
if [:get, :patch, :post, :put, :delete, :mobile_get].include?(method_name) | |
if args.size > 1 && !args[1].loc.expression.source.include?("xhr: true") | |
rub = args[1].loc.expression.source |
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
build_package_patch_ruby_railsexpress() { | |
fetch_git rvm-patchsets git://github.com/skaes/rvm-patchsets.git master | |
for p in rvm-patchsets/patches/ruby/1.9.3/p392/railsexpress/* ; do | |
patch -p1 < $p | |
done | |
} | |
install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz" | |
install_package "ruby-1.9.3-p392" "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz" patch_ruby_railsexpress autoconf standard |
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
build_package_patch_ruby_railsexpress() { | |
fetch_git rvm-patchsets git://github.com/skaes/rvm-patchsets.git master | |
for p in rvm-patchsets/patches/ruby/1.9.3/p327/railsexpress/* ; do | |
patch -p1 < $p | |
done | |
} | |
install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz" | |
install_package "ruby-1.9.3-p327" "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz" patch_ruby_railsexpress autoconf standard |
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
class RestObject | |
(...) | |
## | |
# To be able to serialize objects they can't have Proc's, and @response/@request | |
# have them. So we remove them before actually doing the to_yaml. | |
def to_yaml(*args) | |
old_values = @response, @request | |
@response, @request = nil, nil |
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
def filter_dropdown(select_options, options) | |
current_text = select_options.find { |text, filter| filter == options[:current] }.try(:first) || select_options.first.first | |
image = '<img height="6" width="8" src="/img/v/transparent_r1.gif" class="icn icn-ext-ctr-arrow-down">' | |
link = content_tag :strong do | |
link_to("#{current_text} #{image}".html_safe, "#", :"data-simplelayer" => "##{options[:key]}") | |
end | |
uls = content_tag :ul, :id => options[:key], :class => "dropdown", :style => "display:none" do | |
select_options.map do |text,key| | |
klass = (options[:current] == key ? 'selected' : nil) |
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
def participation_options(invitation) | |
options = [] | |
options << :yes if invitation.can_change_to_yes? || invitation.can_buy_tickets? || invitation.participation == :yes | |
options << :maybe if invitation.can_change_to_maybe? || invitation.participation == :maybe | |
options << :no if invitation.can_change_to_no? || invitation.participation == :no | |
options | |
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
site = URI("https://some.domain.net/path?event_id=#{event.id}") | |
http = Net::HTTP.new(site.host, site.port) | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if Rails.env.development? | |
http.open_timeout = 1 | |
http.read_timeout = 1 | |
req = Net::HTTP::Get.new("#{site.path}?#{site.query}") | |
req.basic_auth 'user', 'pass' |
NewerOlder