I hereby claim:
- I am silasjmatson on github.
- I am silas (https://keybase.io/silas) on keybase.
- I have a public key ASAArOJcqNT9RVatbJ0T-Hy9JLn5IHXUObsUyLapQdFwYQo
To claim this, I am signing this object:
module RSpec | |
module Core | |
module Formatters | |
class EmojiFormatter < BaseTextFormatter | |
def example_passed(_notification) | |
output.print '👌 ' | |
end | |
def example_pending(_notification) |
I hereby claim:
To claim this, I am signing this object:
query.select(" | |
AVG(sale.price) as average_price, | |
MAX(sale.price) as max_price, | |
MIN(sale.price) as min_price, | |
ROUND(AVG(EXTRACT(EPOCH FROM sale.completed_at) - EXTRACT(EPOCH FROM sale.created_at))) as average_sale_time | |
") |
class SalesReportsController < AdminController | |
include ActionController::Live | |
def export | |
respond_to do |format| | |
format.csv { stream_csv_report } | |
end | |
end | |
private |
class ApplicationRecord < ActiveRecord::Base | |
extend DatabaseQueryStreaming | |
self.abstract_class = true | |
end |
module DatabaseQueryStreaming | |
def stream_query_rows(sql_query, options="WITH CSV HEADER") | |
conn = ActiveRecord::Base.connection.raw_connection | |
conn.copy_data "COPY (#{sql_query}) TO STDOUT #{options};" do | |
while row = conn.get_copy_data | |
yield row | |
end | |
end | |
end |
# Usage: countdown <n> [second(s)|minute(s)|hour(s)] [message] | |
# Be sure to quote the 'message' argument | |
function countdown(){ | |
if [ -z $1 ]; then | |
echo "Fuzzy Wuzzy wuz a bear, but now he's a sad \ | |
bear because you didn't tell him how long to wait. 🐻" | |
return 1 | |
fi |
// | |
// AppDelegate.swift | |
// iTunesKiller | |
// | |
// Created by Silas J. Matson on 12/18/14. | |
// | |
import Cocoa | |
@NSApplicationMain |
class API::Registrar | |
# Is this possible? | |
attr_reader :stripe_customer, :postgres_user, :stripe_card | |
def initialize(user_params, card_params) | |
@postgres_user = initialize_postgres_user(user_params) | |
@stripe_customer = initialize_stripe_customer(user_params) | |
@stripe_card = initialize_stripe_card(card_params) | |
end | |
Given the following CoffeeScript class:
class Foo
constructor: ()->
@bar()
bar: ->
$("body").on "click", (e)=>