I hereby claim:
- I am norman on github.
- I am compay (https://keybase.io/compay) on keybase.
- I have a public key whose fingerprint is 1A08 8ED4 32C3 612F 5FF5 677E 74BA BFD3 3159 0D75
To claim this, I am signing this object:
| #!/usr/bin/env ruby | |
| =begin | |
| = Geographic Searches With Postgres's Earthdistance and Cube Extensions | |
| This program shows how to easily create a Postgres database that uses the Cube | |
| and Earthdistance extensions to perform fast queries on geographic data. | |
| Briefly, the problem this code solves is "show me all places within 50 | |
| kilometers of New York City." |
| #------------------------------------------------------------------------------ | |
| # CUSTOMIZED OPTIONS | |
| #------------------------------------------------------------------------------ | |
| # Add settings for extensions here | |
| # | |
| # Some stupid, dangerous settings only used to speed things up on a local | |
| # development machine, where if data is lost I'll just wipe and recreate. | |
| # Never ever ever use these in production or anything approximating | |
| # production. |
| strings = %w[aa áb ac na ña ne oa] | |
| # Provide alphabetical sort in Spanish, where accented vowels are sorted | |
| # the same as unaccented vowels, and "ñ" is sorted directly after "n". | |
| # | |
| # This is accomplished by normalizing the string to Unicode decomposed form | |
| # to break characters with diacritics into multiple characters, and then | |
| # removing acute accents and diaresis: e.g. "á" becomes "a", "ü" becomes | |
| # "u". These are the only two diacritics used for vowels in Spanish. | |
| # |
| # frozen_string_literal: true | |
| require "rails_helper" | |
| describe "Fixtures" do | |
| fixture_table_names.each do |table_name| | |
| model_class = table_name.singularize.classify.constantize | |
| it "has valid #{table_name}" do | |
| expect(model_class.all).to all be_valid | |
| end |
| # coding: utf-8 | |
| # | |
| # Encode any codepoint outside the ASCII printable range to an HTML character | |
| # reference (https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_reference_overview). | |
| def encode(string) | |
| string.each_codepoint.inject("") do |buffer, cp| | |
| cp = "&#x#{cp.to_s(16)};" unless cp >= 0x20 && cp <= 0x7E | |
| buffer << cp | |
| end | |
| end |
| require "benchmark" | |
| puts %x{ruby -v} + "\n" | |
| Benchmark.bmbm do |x| | |
| N = 1_000_000 | |
| a = "aa" | |
| b = "bb" |
| !!! | |
| html | |
| head | |
| body | |
| h1#logo {style: "use a stylesheet please"} | |
| < This is inline content | |
| and can be on multiple lines though I'm | |
| not sure why you'd want to do that | |
| p | |
| > This is block content |
| source 'https://rubygems.org' | |
| gem 'delayed_job' | |
| gem 'delayed_job_active_record' | |
| gem 'daemons' | |
| gem 'pg' |
| git log stable..rails3 --pretty=tformat: --numstat | awk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf "added lines: %s removed lines: %s total lines: %s\n",add,subs,loc }' - | |
| added lines: 13821 removed lines: 16327 total lines: -2506 |
I hereby claim:
To claim this, I am signing this object: