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
{{Infobox software | |
| name = ComfortableMexicanSofa | |
| developer = Oleg Khabarov | |
| released = {{release date|2010|10|13}} | |
| latest_release_version = <!-- If you update this, remember to also update [[List of content management systems]]--> 2.0.7<ref name="comfortable_mexican_sofa_release">https://rubygems.org/gems/comfortable_mexican_sofa/versions/2.0.7</ref> | |
| latest_release_date = {{release date|2017|12|24}} | |
| status = Active | |
| operating_system = [[Cross-platform]] | |
| platform = [[Ruby on Rails]] | |
| genre = [[Content management system]] |
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 | |
gem "bundler", "< 1.16" | |
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
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 'yaml' | |
en_hash = YAML::load_file(File.expand_path('../config/locales/en.yml', File.dirname(__FILE__))) | |
locales = %w(en de es fr nl pt-BR zh-CN zh-TW) | |
def fix_locale(locale_hash, en_hash) | |
result_hash = locale_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
#!/usr/bin/env ruby | |
# Small script to join and clean-up ACA gpx files. | |
# Setup: | |
# - make sure you got nokogiri installed (gem install nokogiri) | |
# - throw this merger.rb in some directory | |
# - inside that directory create input/ folder | |
# - copy ACA .gpx files into that folder. Generally {direction}Main files plus Services files | |
# Usage: | |
# - from terminal run ./merger.rb |
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
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
brew update && brew upgrade postgresql | |
initdb /usr/local/var/postgres9.5.1 -E utf8 | |
pg_upgrade -d /usr/local/var/postgres -D /usr/local/var/postgres9.5.1 -b /usr/local/Cellar/postgresql/9.4.2/bin/ -B /usr/local/Cellar/postgresql/9.5.1/bin/ -v | |
rm -rf postgres |
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
module Enumerable | |
# Iterate through enumerable with alpha index instead of integers | |
def each_with_alpha_index(index = 'a') | |
each do |element| | |
yield element, index | |
index.next! | |
end | |
end | |
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_relative '../test_helper' | |
class I18nIntegrationTest < ActionDispatch::IntegrationTest | |
def collect_combined_keys(hash, ns = nil) | |
hash.collect do |k, v| | |
keys = [ ] | |
keys << collect_combined_keys(v, "#{ns}.#{k}") if v.is_a?(Hash) | |
keys << "#{ns}.#{k}" | |
end.flatten |
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
vagrant@jun-group:~/player$ rails s torquebox | |
=> Booting TorqueBox | |
=> Rails 3.2.18 application starting in development on http://0.0.0.0:3000 | |
=> Call with -d to detach | |
=> Ctrl-C to shutdown server | |
Exiting | |
NameError: missing class or uppercase package name (`com.jungroup.player.geocoding.ZipcodeTranslator') | |
get_proxy_or_package_under_package at org/jruby/javasupport/JavaUtilities.java:54 | |
method_missing at file:/home/vagrant/.rvm/rubies/jruby-1.7.8/lib/jruby.jar!/jruby/java/java_package_module_template.rb:14 | |
(root) at /home/vagrant/player/lib/geo_code.rb:7 |
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
module Foo | |
def hello | |
puts 'foo' | |
end | |
end | |
module Bar | |
def hello | |
puts 'bar' | |
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
class Hash | |
def deep_slice(*allowed_keys) | |
sliced = { } | |
allowed_keys.each do |allowed_key| | |
if allowed_key.is_a?(Hash) | |
key = allowed_key.keys.first | |
sliced[key] = self[key].deep_slice(*[allowed_key.values].flatten) if self[key] | |
else | |
sliced[allowed_key] = self[allowed_key] if self[allowed_key] |
NewerOlder