I hereby claim:
- I am ndemianc on github.
- I am ndemianc (https://keybase.io/ndemianc) on keybase.
- I have a public key ASBLihFG_HQlBwIv69F1pQ3HTr3VgnpAtkSuCboGTeAARQo
To claim this, I am signing this object:
# How to use Ruby Prof to profile Sidekiq Worker | |
require 'ruby-prof' | |
result = RubyProf.profile do | |
#Code to analyse in a method | |
EsIndexWorker.new.perform | |
end | |
require "benchmark" | |
h = { a: { b: { c: { d: { e: "foo" } } } } } | |
n = 50_000 | |
Benchmark.bmbm(7) do |x| | |
x.report "Hash#dig" do | |
n.times do ; h.dig(:a, :b, :c, :d, :e); end | |
end |
I hereby claim:
To claim this, I am signing this object:
docker stop $(docker ps -a -q) | |
docker rm $(docker ps -a -q) |
require 'benchmark' | |
array = Array.new(1_000_000, { id: 'key' }) | |
values = ['.p12', '.pfx'] | |
Benchmark.bmbm(7) do |bm| | |
bm.report('to_h') do | |
array.map do |prop| | |
[ | |
prop[:id], |
import redis | |
r = redis.StrictRedis(host='localhost', port=6379, decode_responses=True, password='123') | |
r.hset('candidate:1', 'name', 'Mary Sue') | |
r.hset('candidate:1', 'position', 'super tester') | |
r.hget('candidate:1', 'name') | |
m = r.hgetall('candidate:1') | |
print(m['name']) |
defmodule Project do | |
@moduledoc """ | |
This module includes example code of the Elixir linked tasks based on the Elixir linked processes. | |
""" | |
@doc """ | |
Create new task. | |
Returns `{:ok, pid}` | |