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
Language family Language name Native name 639-1 639-2/T 639-2/B 639-3 Notes | |
Northwest Caucasian Abkhaz аҧсуа ab abk abk abk | |
Afro-Asiatic Afar Afaraf aa aar aar aar | |
Indo-European Afrikaans Afrikaans af afr afr afr | |
Niger-Congo Akan Akan ak aka aka aka + 2 macrolanguage, Twi is [tw/twi], Fanti is [fat] | |
Indo-European Albanian Shqip sq sqi alb sqi + 4 macrolanguage | |
Afro-Asiatic Amharic አማርኛ am amh amh amh | |
Afro-Asiatic Arabic العربية ar ara ara ara + 30 macrolanguage, Standard Arabic is [arb] |
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/capistrano" # ejecuta el bundle luego del deployment | |
# set(var, value) | |
set :rails_env, "production" | |
set :application, "example" | |
set :domain, "www.example.com.ar" | |
# una mejor explicacion de como trabajan los roles la pueden encontrar en https://github.com/capistrano/capistrano/wiki/2.x-From-The-Beginning | |
role :app, domain | |
role :web, domain |
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 to_csv | |
header = Product.columns.map(&:name).join(',') | |
rows = Product.all.map do |record| | |
returning [] do |row| | |
Product.columns.each { |c| row << record.send(c) } | |
end.join(',') | |
end | |
[header, rows.join("\n")].join("\n") | |
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
csv_data = FasterCSV.generate do |csv| | |
# por ahora todas pero habra que dejar afuera la imagen y los templates html | |
# headers | |
csv << Product.columns.map(&:name) | |
Product.all.each do |record| | |
csv << Product.columns.map { |c| record.send(c.name) } | |
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
date: | |
formats: | |
default: "%Y-%m-%d" | |
short: "%b %d" | |
long: "%B %d, %Y" | |
long_ABY-HM: '%A %B %Y - %H:%M' #Sunday September 11 - 15:33 | |
long_HM-ABD: '%H:%M - %A %B %d' #16:20 - Thursday September 8 | |
short_Bd,Y: '%B %d, %Y' #September 8, 2011 | |
short_BY': '%B %Y' #September 2011 |
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 I18nCustom | |
def self.included(base) | |
base.send :alias_method_chain, :html_message, :data_attributes | |
end | |
def html_message_with_data_attributes | |
keys.shift # discard the locale | |
key = keys.last.to_s.gsub('_', ' ').gsub(/\b('?[a-z])/) { $1.capitalize } | |
translation_key = keys.join('.') | |
text_to_translate = I18n.t translation_key, :locale => I18n.default_locale, :default => '' |
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 error_messages_for(objects, options = {}) | |
objects = Array(objects) | |
count = objects.inject(0) {|sum, object| sum + object.errors.count } | |
unless count.zero? | |
html = {} | |
[:id, :class].each do |key| | |
if options.include?(key) | |
value = options[key] | |
html[key] = value unless value.blank? |
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
var user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.20 (KHTML, like Gecko) Chrome/19.0.1036.7 Safari/535.20'; | |
var Browser = require("zombie"); | |
var browser = new Browser({userAgent: user_agent, debug: true, waitFor: 10000}); | |
var url = 'https://accounts.google.com/ServiceLoginAuth'; | |
var login = '[email protected]'; | |
var password = 'foo'; | |
browser.visit(url, function() { |
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
Zombie: GET https://accounts.google.com/ServiceLoginAuth | |
Zombie: GET https://accounts.google.com/ServiceLoginAuth => 200 | |
Zombie: POST https://accounts.google.com/ServiceLoginAuth | |
Zombie: POST /ServiceLoginAuth => https://accounts.google.com/CheckCookie?chtml=LoginDoneHtml&checkedDomains=youtube&pstMsg=0 | |
Zombie: GET https://accounts.google.com/CheckCookie?chtml=LoginDoneHtml&checkedDomains=youtube&pstMsg=0 | |
Zombie: GET https://accounts.google.com/CheckCookie?chtml=LoginDoneHtml&checkedDomains=youtube&pstMsg=0 => 400 | |
<html lang="en"> <meta charset="utf-8"> | |
<meta name="viewport" content="initial-scale=1, minimum-scale=1, width=device-width"> | |
<title>Error 400 (Bad Request)!!1</title> |
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 'rubygems' | |
require 'mechanize' | |
bot = Mechanize.new | |
bot.log = $stdout | |
bot.get('https://www.google.com/webmasters/tools') do |login_page| | |
home_page = login_page.form_with(:action => /ServiceLoginAuth/) do |f| | |
f.field_with(:name => 'Email').value = '[email protected]' | |
f.field_with(:name => 'Passwd').value = '{the correct pass}' |
OlderNewer