View check.md

Should style Markdown headers

Should handle basic styling like inline code, italic text, bold text, but should not italicize_inline under_lined text.

  • A list item
  • Some inline code
  • Etc lorem ipsum

Should highlight code blocks:

View find_uniq.rb
require 'set'
def find_uniq(ids)
# O(n) space
# uniqs = Set.new
# ids.each do |id|
# uniqs.delete(id) unless uniqs.add?(id)
# end
# uniqs.first
# O(1) space
View trace_calls.rb
module TraceCalls
def self.included(base)
[base, base.singleton_class].each do |klass|
klass.instance_methods(false).each do |existing_method|
wrap(klass, existing_method)
end
end
def base.method_added(method)
TraceCalls.run_method_added(self, method, __method__)
View inheritance_hierarchy.rb
module Extendable # :nodoc:
def self.extended(base)
base.include InstanceMethods
end
module InstanceMethods # :nodoc:
def hello
puts 'hello from Extendable'
super
end
View move_heroku_pg_to_aws_rds.md
  1. Prepare your RDS instance and [authorize access to it]1.

  2. Put your app in maintenance mode:

    heroku maintenance:on
  3. Save the latest SQL dump of the DB:

View keybase.md

Keybase proof

I hereby claim:

  • I am halilim on github.
  • I am halil (https://keybase.io/halil) on keybase.
  • I have a public key whose fingerprint is A008 B2E0 8F6A 766C 707B 449B 99D4 1574 5D45 32C6

To claim this, I am signing this object:

View ruby_cryptology.rb
CIPHER = { 'a' => 'n', 'b' => 'o', 'c' => 'p', 'd' => 'q',
'e' => 'r', 'f' => 's', 'g' => 't', 'h' => 'u',
'i' => 'v', 'j' => 'w', 'k' => 'x', 'l' => 'y',
'm' => 'z', 'n' => 'a', 'o' => 'b', 'p' => 'c',
'q' => 'd', 'r' => 'e', 's' => 'f', 't' => 'g',
'u' => 'h', 'v' => 'i', 'w' => 'j', 'x' => 'k',
'y' => 'l', 'z' => 'm' }.freeze
REVERSE_CIPHER = CIPHER.invert.freeze
View assets.rb
# config/initializers/assets.rb
# ...
# The last two are for the file browser
Rails.application.config.assets.precompile += %w(ckeditor/config ckeditor/application ckeditor/filebrowser/*)
View helpers.rb
# spec/support/helpers.rb
require 'support/helpers/i18n_helpers'
# ...
RSpec.configure do |config|
config.include Features::I18nHelpers, type: :feature
# ...
end
View Chewy_price_filter.rb
# Assumes gems: Chewy, Money and eu_central_bank
class SearchForm
include ActiveModel::Model
DEFAULTS = { 'currency' => 'TRY' }
attr_accessor :price_min, :price_max, :currency
# ...