I hereby claim:
- I am codesoda on github.
- I am codesoda (https://keybase.io/codesoda) on keybase.
- I have a public key whose fingerprint is 853B 995C FFCE D1C2 5BEE 60C3 D37F 6671 2482 5F74
To claim this, I am signing this object:
# config/applications.rb | |
config.middleware.use "Utf8Sanitizer::Middleware" | |
# lib/utf8_sanitizer.rb | |
module Utf8Sanitizer | |
class Middleware | |
SANITIZE_ENV_KEYS = %w( |
I hereby claim:
To claim this, I am signing this object:
# Run code only if it's a certain day of the week | |
# e.g. | |
# on(:monday) do | |
# puts "it's monday" | |
# end | |
module OnlyOn | |
def on(day, options = {}) | |
yield if block_given? && day_of_week == day | |
end |
--color | |
--format Fuubar | |
--require spec_helper |
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
require "sinatra/base" | |
require "sinatra/namespace" | |
require "multi_json" | |
require "api/authentication" | |
require "api/error_handling" | |
require "api/pagination" | |
module Api | |
class Base < ::Sinatra::Base |
public static class RouteCollectionExtensions | |
{ | |
private static void MapResources(this RouteCollection routes, string model) | |
{ | |
MapResources(routes, model, model + "s"); | |
} | |
private static void MapResources(this RouteCollection routes, string model, string models) | |
{ | |
// models - index |
def time_for | |
started_at = Time.now | |
yield | |
elapsed = Time.now - started_at | |
end | |
# elapsed = time_for { 5 * i } | |
# otherwise Benchmark.measure { 5 * i } |
$ heroku pg:backups capture -r REMOTE | |
$ heroku pg:backups public-url b001 -r REMOTE | |
$ pg_restore --verbose --clean --no-acl --no-owner -d DATABASE DUMP |
# use mac notification center | |
notification :terminal_notifier | |
guard :rspec, cmd: 'bin/rspec' do | |
require "guard/rspec/dsl" | |
dsl = Guard::RSpec::Dsl.new(self) | |
# Feel free to open issues for suggestions and improvements | |
# RSpec files |