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 323D 61B6 0AC7 6D5D AAE3 9F9B 1C12 24B1 298D BF94
To claim this, I am signing this object:
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 } |
I hereby claim:
To claim this, I am signing this object:
/* | |
* Repeater.js | |
*/ | |
(function (window) { | |
'use strict'; | |
function Repeater(callback, timeout) { | |
var self = this; |
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 |
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 |
require 'set' | |
last = (ARGV.shift || fail('<int> Permute of last n chars must be set')).to_i | |
seed = ARGV | |
fail 'At least one seed must be provided' if seed.empty? | |
def say(name) | |
puts name | |
`say #{name}` |
function countCSSRules() { | |
var results = '', | |
log = ''; | |
if (!document.styleSheets) { | |
return; | |
} | |
for (var i = 0; i < document.styleSheets.length; i++) { | |
countSheet(document.styleSheets[i]); | |
} | |
function countSheet(sheet) { |
ROOM_ID=yourroomname | |
OWNER_ID=XXXYYYX | |
AUTH_TOKEN=XXXYYYXXX | |
MESSAGE="Hello world!" | |
curl --header "content-type: application/json" --header "Authorization: Bearer $AUTH_TOKEN" -X POST \ | |
-d "{\"name\":\"dev\",\"privacy\":\"private\",\"is_archived\":false,\"is_guest_accessible\":false,\"topic\":\"cURL\",\"message\":\"Message sent to HipChat from cURL\",\"color\":\"green\",\"owner\":{\"id\":$OWNER_ID}}" https://api.hipchat.com/v2/room/$ROOM_ID/notification |
# Rails StrongParameters refactor | |
# | |
# Inspired by Ryan Bates's Screencast #371 | |
# http://railscasts.com/episodes/371-strong-parameters | |
# | |
# A simple pattern to refactor permitted params for Rails with StrongParameters. | |
# app/models/author.rb | |
class Author < ActiveRecord::Base | |
validates_presence_of :name, :birth_date |
# 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. |