I hereby claim:
- I am buren on github.
- I am buren (https://keybase.io/buren) on keybase.
- I have a public key whose fingerprint is A7ED 5FE6 79AA 414B 405F E637 CCC5 6E36 265C 2FB3
To claim this, I am signing this object:
class I18nGenerator | |
attr_reader :models, :lang_code | |
def initialize(lang_code: :en) | |
ignored_tables = %w(schema_migrations) | |
@models = ActiveRecord::Base.connection.tables - ignored_tables | |
@models.map! { |model| model.singularize.camelize.constantize } | |
@lang_code = lang_code.to_s | |
end |
class ActiveTableView | |
def initialize(opts) | |
@col_names = opts.fetch(:cols) | |
@records = opts.fetch(:records) | |
@model_name = rows.table_name.singularize | |
end | |
def headers | |
@col_names.map { |name| t_col(name) } | |
end |
/* | |
* Repeater.js | |
*/ | |
(function (window) { | |
'use strict'; | |
function Repeater(callback, timeout) { | |
var self = this; |
DEADLINE = Time.new(2015, 9, 21, 13, 0, 0).freeze | |
module Audience;end | |
module Audience::Talk;end | |
String.class_eval { define_method(:last?) { false } } | |
NilClass.class_eval { define_method(:last?) { true } } | |
define_method(:wait) { puts 'Still not ready..';sleep 3 } | |
define_method(:any_questions?) { puts 'Any questions?' } | |
define_method(:feedback) { puts 'Feedback?' } | |
class Audience::Presenter < Struct.new(:name) | |
define_method(:ready?) { Time.now >= DEADLINE } |
function describe(label, testFunction) { | |
return new test(label, testFunction); | |
} | |
function test(label, testFunction) { | |
var self = this; | |
self.testLabel = label; | |
self.itLabel; | |
var label = function() { return self.testLabel + ' ' + self.itLabel; }; | |
var passed = function() { console.log(label(), true); }; |
def describe(label) | |
fails = [] | |
it = ->(it_label, &block) { | |
assert = ->(expected, result) { | |
passed = ->() { print '.' } | |
failed = ->() { | |
print 'F' | |
fails << "#{label} #{it_label}, expected '#{expected}', but was '#{result}'." | |
} | |
expected == result ? passed.() : failed.() |
I hereby claim:
To claim this, I am signing this object:
# config/initializers/web_console.rb | |
WebConsoleBeforeAction = ->(controller) do | |
controller.console if controller.params[:web_console] | |
end | |
ApplicationController.before_action(WebConsoleBeforeAction) if defined?(WebConsole) && Rails.env.development? | |
# NOTE: | |
# For security reasons only do this in development. |
// Extract and convert languages @ below URL to CSV | |
// https://meta.wikimedia.org/wiki/Template:List_of_language_names_ordered_by_code | |
var langCode = []; | |
$('.wikitable tbody tr td:nth-child(1)').each(function(){ | |
langCode.push($(this).text()); | |
}); | |
var enName = []; | |
$('.wikitable tbody tr td:nth-child(2)').each(function(){ |
var fs = require('fs') | |
var JsonApiDataStore = require('jsonapi-datastore').JsonApiDataStore; | |
function readExampleToObject(fileName, callback) { | |
fs.readFile(fileName, 'utf8', function (err, data) { | |
if (err) { | |
return console.log(err); | |
} | |
return callback(JSON.parse(data)); | |
}); |