Skip to content

Instantly share code, notes, and snippets.

View arielvalentin's full-sized avatar

Ariel Valentin arielvalentin

View GitHub Profile
context = Context.current
Fiber.new {
Context.with_context(context) do
# your fiber code
OpenTelemetry::Trace.current_span.finish
end
}
Thread ->
### Keybase proof
I hereby claim:
* I am arielvalentin on github.
* I am arielvalentin (https://keybase.io/arielvalentin) on keybase.
* I have a public key ASDdELUy6nPv1VvixRn17bdyqOEQZSfeTP59I4svCLsqVAo
To claim this, I am signing this object:
@arielvalentin
arielvalentin / Correct results
Last active August 23, 2017 15:58
Redshift Random Characters
Redshift Query ID 905905
psql> with
ld as (select distinct date_trunc('day', (day)::timestamp)::date as date, first_value(day) over (partition by date_trunc('day', (day)::timestamp)::date order by "day" desc rows unbounded preceding) as last_day from events.stripe_logic_views.ten_years_in_days_from_first_invoice where 1=1
) select
date
, add_on_plan_id
, sum(amortized_total_amount / 100) as total_mrr
from
stripe_logic_views.daily_mrr_by_customer d
@arielvalentin
arielvalentin / txt
Created August 23, 2017 15:03
Redshift Random Characters
psql> with
ld as (select distinct date_trunc('day', (day)::timestamp)::date as date, first_value(day) over (partition by date_trunc('day', (day)::timestamp)::date order by "day" desc rows unbounded preceding) as last_day from events.stripe_logic_views.ten_years_in_days_from_first_invoice where 1=1
) select
date
, add_on_plan_id
, sum(amortized_total_amount / 100) as total_mrr
from
stripe_logic_views.daily_mrr_by_customer d
join ld on
ld.last_day = d.day
@arielvalentin
arielvalentin / txt
Created August 23, 2017 15:03
Redshift Random Characters
psql> with
ld as (select distinct date_trunc('day', (day)::timestamp)::date as date, first_value(day) over (partition by date_trunc('day', (day)::timestamp)::date order by "day" desc rows unbounded preceding) as last_day from events.stripe_logic_views.ten_years_in_days_from_first_invoice where 1=1
) select
date
, add_on_plan_id
, sum(amortized_total_amount / 100) as total_mrr
from
stripe_logic_views.daily_mrr_by_customer d
join ld on
ld.last_day = d.day
@arielvalentin
arielvalentin / Success.log
Last active January 21, 2016 16:04
traceroute test results
→ traceroute -v -S -d www.att.net
traceroute to user-att-104-57-184-0.e8938.g.akamaiedge.net (172.226.108.142), 64 hops max, 52 byte packets
1 dsldevice.attlocal.net (192.168.1.254) 60 bytes to 192.168.1.85 1.567 ms 0.909 ms 0.759 ms (0% loss)
2 107-220-56-1.lightspeed.austtx.sbcglobal.net (107.220.56.1) 60 bytes to 192.168.1.85 15.635 ms 7.031 ms 2.771 ms (0% loss)
3 71.149.77.112 (71.149.77.112) 60 bytes to 192.168.1.85 4.537 ms 4.214 ms 3.676 ms (0% loss)
4 75.8.128.144 (75.8.128.144) 60 bytes to 192.168.1.85 4.284 ms 3.830 ms 3.517 ms (0% loss)
5 12.83.68.137 (12.83.68.137) 76 bytes to 192.168.1.85 5.886 ms
12.83.68.145 (12.83.68.145) 76 bytes to 192.168.1.85 6.912 ms
12.83.68.137 (12.83.68.137) 76 bytes to 192.168.1.85 7.159 ms (0% loss)
6 gar2.dlrtx.ip.att.net (12.122.100.89) 76 bytes to 192.168.1.85 12.416 ms 11.747 ms 14.065 ms (0% loss)
@arielvalentin
arielvalentin / Gemfile
Last active January 3, 2016 23:19 — forked from mkristian/Gemfile
source 'https://rubygems.org'
# Specify your gem's dependencies in vtd-xml.gemspec
gemspec
# needed to build the gem but fails when it is part of the gems
gem "ruby-maven", '~> 3.1.1.0'
@arielvalentin
arielvalentin / gem_home_issue.sh
Last active January 2, 2016 18:58
JRuby Build Error
# well...
arielvalentin@kimura:~/dev/repos/jruby
git:(1.7.5-424-gc4ecd6b)
→ GEM_HOME=./lib/ruby/gems/shared/ bin/jruby -S bin/rake test:mri19 --trace
...
5012 tests, 874184 assertions, 0 failures, 0 errors, 9 skips
** Execute test:mri19
@arielvalentin
arielvalentin / manually_add_to_classpath.log
Last active January 2, 2016 04:39
Starting MiniAccumuloCluster via JRuby
→ jruby manually_add_to_classpath.rb
/var/folders/4m/jqf69nlx38s5hyqp10y9_bvc0000gp/T/d20140107-525-wdgmbz
grabbed zookeeper
crated table
wrote record
created a scanner
anger
wtf
@arielvalentin
arielvalentin / jruby_timeout.rb
Last active December 23, 2015 09:29 — forked from jorgenpt/jruby_timeout.rb
Don't use this
# Workaround for IO.popen.readlines being allowed to block indefinitely even if
# wrapped in a Timeout::timeout call.
#
# Test case:
# $ time jruby -rtimeout -e "timeout(1) { IO.popen('sleep 10').readlines }"
# * Propagating errors executed in the block
# * Thread.raise experiences a TypeError because it cannot convert a java Exception into a ruby Error so I've added handling any errors raised from the java code to be propagated correctly
# * Renamed some variables so that they matched
require 'timeout'