Skip to content

Instantly share code, notes, and snippets.

View raels's full-sized avatar

Raels Koder raels

  • San Francisco Bay Area
View GitHub Profile
@raels
raels / sql_prettyinator.rb
Created February 16, 2022 22:55
simple ruby code to prettify a sql query
#
# Render a reasonably styled string for a SQLquery string
#
# @param [String] s The SQL query string to style
#
# @return [String] The reasonably styled string
#
def self.pretty(s)
s.gsub(/\b(SELECT|INNER JOIN|JOIN|FROM|WHERE)\b/, "\n\\1")
.gsub(/\b(INNER JOIN|JOIN)\b/, "\t\\1")
@raels
raels / pal.rb
Last active June 17, 2020 13:39
# frozen_string_literal: true
require 'pp'
require 'benchmark'
require 'set'
pals = [
"civic",
"mom",
"anna",
"kayak",
{
"basics": {
"label": "Technologist",
"characterClass": "Programmer",
"quote": "No software is finished until the last user has died.",
"phone": "+1.650.454.5716",
"email": "someone@somewhere.com",
"other": [],
"name": "Justin Case",
"summary": "Technologist with extensive experience spanning individual contributor to executive roles, across hardware and software technologies. Repeated startup and enterprise successes, including Sybase, BEA Systems, Seeker Software (acquired by Concur), Signio (now PayPal). Adept at new projects for startups, enterprises, and skunk-works that require systems thinking combined with hands-on executive and technical skills. Extensive agile and traditional project management background. My passion is discovering, investigating, understanding, and then incorporating new technologies and ideas into greenfield or existing system development projects that drive great business outcomes. Comfortable from cubicle to boardroom.",
@raels
raels / fast_fib.rb
Last active October 18, 2018 06:35
Ruby Fibonacci in O(log N) time
# compute x'th fibonacci using recurrence relation
# O(log n)
def fib x
return x if x < 2
fib_helper(x).first
end
def fib_helper x
case

Keybase proof

I hereby claim:

  • I am raels on github.
  • I am raels (https://keybase.io/raels) on keybase.
  • I have a public key ASCIzIGE88oP41FfcWh_mu9Hi9kWti9ylTHvVRaM1r1uoAo

To claim this, I am signing this object: