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:
public class JsonBuilder | |
{ | |
private readonly StringBuilder _sb; | |
private readonly Stack<bool> _hasPreviousProperties; | |
private bool RequiresComma { get { return _hasPreviousProperties.Count > 0 && _hasPreviousProperties.Peek(); } } | |
public JsonBuilder() { | |
_sb = new StringBuilder(); |
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 } |
<!-- | |
the select needs | |
- "has_other" css class | |
- "data-other" attribute, which points to the id of the element to hide/show (normally a textbox) | |
- "data-other-text" attribute, which indicates the text which indicates that other has been selected | |
--> | |
<select class="has_other" data-other="#textbox_id" data-other-text="...other"> | |
<option>option 1</option> | |
<option>...other</option> |
$ 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 |
# 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:
We will be building a Generic Tagging JSON API that can store, retrieve, delete and report on the usage of a "tag" across different entities. This is a guide for the endpoints, if you think you have a better route or would like to modify the naming/schema feel free. We like specs, so we hope you do to.
POST /tag
- Entity Type, e.g. 'Product', 'Article'
# 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 |