- What is a class?
- What is an object?
- What is a module? Can you tell me the difference between classes and modules?
- Can you tell me the three levels of method access control for classes and modules? What do they imply about the method?
- There are three ways to invoke a method in ruby. Can you give me at least two?
- Explain this ruby idiom: a ||= b
This file contains hidden or 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
const buffer = require('buffer'); | |
const crypto = require('crypto'); | |
// Demo implementation of using `aes-256-gcm` with node.js's `crypto` lib. | |
const aes256gcm = (key) => { | |
const ALGO = 'aes-256-gcm'; | |
// encrypt returns base64-encoded ciphertext | |
const encrypt = (str, aad) => { | |
// Hint: the `iv` should be unique (but not necessarily random). |
This file contains hidden or 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 "benchmark" | |
include Benchmark | |
values = (0..10_000_000).to_a | |
bm(1_000_000) do |bench| | |
bench.report("map and select") do | |
values.map { |x| x * 3 }.select { |x| x % 4 == 0 } | |
end | |
bench.report("inject") do |
This file contains hidden or 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
import Ember from "ember"; | |
export default Ember.Helper.helper(function([content, group, contentGroupKey]) { | |
return content.filterBy(contentGroupKey, group); | |
}); |
This file contains hidden or 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' | |
specs_with_extensions = Gem::Specification.each.select { |spec| spec.extensions.any? } | |
specs_with_extensions.each do |spec| | |
puts "#{spec.name} (extensions: #{spec.extensions.inspect})" | |
end |
This file contains hidden or 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
groups = Rails.groups(assets: %w(development test)) | |
groups << ENV["GITHUB_USER"] unless user.blank? unless Rails.env.production? | |
Bundler.require(*groups) |
This file contains hidden or 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
rds-modify-db-parameter-group dox-prod-55 \ | |
--parameters="name=character_set_server, value=utf8, method=pending-reboot" \ | |
--parameters="name=collation_server, value=utf8_general_ci, method=pending-reboot" \ | |
--parameters="name=tmp_table_size, value=4563402752, method=pending-reboot" \ | |
--parameters="name=max_heap_table_size, value=4563402752, method=pending-reboot" \ | |
--parameters="name=query_cache_type, value=1, method=pending-reboot" \ | |
--parameters="name=query_cache_size, value=2281701376, method=pending-reboot" \ | |
--parameters="name=table_open_cache, value=2500, method=pending-reboot" \ | |
--parameters="name=join_buffer_size, value=1140850688, method=pending-reboot" \ | |
--parameters="name=thread_cache_size, value=5803, method=pending-reboot" \ |
This file contains hidden or 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
diff --git a/app/models/inbox/recruiter_message.rb b/app/models/inbox/recruiter_message.rb | |
index 2373ae2..c1b7eab 100644 | |
--- a/app/models/inbox/recruiter_message.rb | |
+++ b/app/models/inbox/recruiter_message.rb | |
@@ -20,6 +20,8 @@ class Inbox::RecruiterMessage < Inbox::Message | |
validate :available_credits, on: :create | |
validate :active_subscription, on: :create | |
+ after_create :doc_mail_debit | |
+ |
This file contains hidden or 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(['userAttributes', 'backbone', 'user_router'], function (config, Backbone, UserRouter) { | |
var userRouter = new UserRouter() { | |
userAttributes: userAttributes | |
}; | |
return router; | |
}); |
This file contains hidden or 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
# | |
# Cookbook Name:: jenkins | |
# Recipe:: default | |
# | |
# https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu | |
# This is super-simple, compared to the other Chef cookbook I found | |
# for Jenkins (https://github.com/fnichol/chef-jenkins). | |
# | |
# This doesn't include Chef libraries for adding Jenkin's jobs via |
NewerOlder