Skip to content

Instantly share code, notes, and snippets.

View gudata's full-sized avatar
🏢
Working from office

gudata

🏢
Working from office
View GitHub Profile

This is how we test that all translation keys match up between locales.

Stuff that only goes in one locale (such as an admin section) or that can't be translated yet (if you use external translators) can simply go in files that don't match the path "config/locales/??.yml", like "config/locales/wip.fo.yml".

sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
sudo apt-get install postgresql-9.2 postgresql-server-dev-9.2 postgresql-contrib-9.2
sudo su -l postgres
psql -d template1 -p 5433
CREATE EXTENSION IF NOT EXISTS hstore;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
service postgresql stop
/usr/lib/postgresql/9.2/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.2/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.2/main/ -O "-c config_file=/etc/postgresql/9.2/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf"
#nginx configuration
upstream simple_ci {
server unix:///tmp/simple_ci.0.sock;
}
server {
listen 80 default_server; # e.g., listen 192.168.1.1:80;
server_name ci.empowerunited.com; # e.g., server_name source.example.com;
root /home/ci_user/simple_ci/public;
o = -> { 'o' }
def activate! *args
print args.map(&:call)
end
activate! o,o
@gudata
gudata / rur_intro.rb
Last active August 29, 2015 14:20 — forked from kanmeiban/rur_intro.rb
# RUR (Relationally Universal Ruby) is a Ruby relational algebra DSL
# that compiles to SQL, allowing you to write complex
# queries without leaving your favorite language. It is going to be a nice
# Ruby-like replacement of SQL in the same manner CoffeeScript is a
# Ruby-like replacement of JavaScript. It will use all the features
# found in a modern RDBMS (views, temp views, constraints, triggers, functions,
# etc) without being tightly coupled to one particular implementation.
#
# Unlike ActiveRecord, which maps tables to classes, RUR maps relations to
# objects.
class Buy
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::MongoTranslation
has_many_related :criterias
field :contact_id, :type => Integer, :index => true
field :offer_type_id, :type => Integer, :index => true
def model_name
if @options.key? :resource
@options[:resource].to_s.tableize.singularize
else
params[:controller].sub("Controller", "").underscore.split('/').last.singularize
end
end
http://staging.psspy.se/dagens/widget?id=25411&widget[agent_font]=Arial%2CHelvetica%2Csans-serif%3B&widget[agent_font_size]=11&widget[article_chunk_color]=%23847B7B&widget[article_chunk_font]=Verdana%2CArial%2CHelvetica%2Csans-serif%3B&widget[article_chunk_font_size]=12&widget[article_title_color]=%23847B7B&widget[article_title_font]=Verdana%2CArial%2CHelvetica%2Csans-serif%3B&widget[article_title_font_size]=12&widget[box_title]=Nyheter+om+R%C3%A4ttvik&widget[box_title_color]=%23000000&widget[box_title_font]=Verdana%2CArial%2CHelvetica%2Csans-serif%3B&widget[box_title_font_size]=16&widget[chunk_font]=Arial%2CHelvetica%2Csans-serif%3B&widget[chunk_font_size]=11&widget[chunk_size]=250&widget[copyright_color]=%23847B7B&widget[copyright_link_color]=%23000000&widget[height]=700px&widget[iframe_link]=&widget[link_target]=_top&widget[max_results]=5&widget[result_title_font]=Arial%2CHelvetica%2Csans-serif%3B&widget[result_title_font_size]=11&widget[show_more]=%23847B7B&widget[source_name_color]=%231352B9&widget[tab_n
http://staging.psspy.se/dagens/widget?id=25411&widget[agent_font]=Arial%2CHelvetica%2Csans-serif%3B&widget[agent_font_size]=11&widget[article_chunk_color]=%23847B7B&widget[article_chunk_font]=Verdana%2CArial%2CHelvetica%2Csans-serif%3B&widget[article_chunk_font_size]=12&widget[article_title_color]=%23847B7B&widget[article_title_font]=Verdana%2CArial%2CHelvetica%2Csans-serif%3B&widget[article_title_font_size]=12&widget[box_title]=Nyheter+om+Rättvik&widget[box_title_color]=%23000000&widget[box_title_font]=Verdana%2CArial%2CHelvetica%2Csans-serif%3B&widget[box_title_font_size]=16&widget[chunk_font]=Arial%2CHelvetica%2Csans-serif%3B&widget[chunk_font_size]=11&widget[chunk_size]=250&widget[copyright_color]=%23847B7B&widget[copyright_link_color]=%23000000&widget[height]=700px&widget[iframe_link]=&widget[link_target]=_top&widget[max_results]=5&widget[result_title_font]=Arial%2CHelvetica%2Csans-serif%3B&widget[result_title_font_size]=11&widget[show_more]=%23847B7B&widget[source_name_color]=%231352B9&widget[tab_name_b
mysql> select id, name, query, id from agents where user_id = 7814;
+-------+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+
| id | name | query