Skip to content

Instantly share code, notes, and snippets.

View ritec's full-sized avatar

Ri Caragol ritec

View GitHub Profile
@ritec
ritec / dj_objects.txt
Created February 27, 2024 15:24 — forked from EBashkoff/dj_objects.txt
Get Objects from Delayed Job
Get a deserialized object from a delayed job:
1. Get the delayed_job record using the id: dj = DelayedJob.find(<id>)
2. Get the handler field from dj: dj.handler
3. Convert it from YAML: YAML.parse(dj.handler)
4. You can get the ruby objects that the delayed job was built with by converting that to_ruby and calling the object:
YAML.parse(dj.handler).to_ruby.user
YAML.parse(dj.handler).to_ruby.prospect
YAML.parse(dj.handler).to_ruby.agent
etc.
@ritec
ritec / gist:3c0518ad798c382281ea320ebba28820
Created August 21, 2023 15:56 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@ritec
ritec / Caddyfile
Created May 17, 2023 16:07 — forked from argami/Caddyfile
Execute HTTPS Local development in 1 Step
https:// {
log
tls internal {
on_demand
}
reverse_proxy :3000
}
@ritec
ritec / webpacker_rails.md
Created April 13, 2023 18:45 — forked from maxivak/webpacker_rails.md
Webpack, Yarn, Npm in Rails
@ritec
ritec / model.rb
Created July 30, 2021 20:24 — forked from aaronsakowski/model.rb
Searchkick autocomplete by token
searchkick autocomplete: ["name"],
settings: {
analysis: {
analyzer: {
searchkick_keyword: {
type: "custom",
tokenizer: "keyword",
filter: ["lowercase", "snowball"]
},
default_index: {
@ritec
ritec / blank.html
Created September 30, 2019 19:51 — forked from geetarista/blank.html
Blank favicon
<link href="data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAF0lEQVRIx2NgGAWjYBSMglEwCkbBSAcACBAAAeaR9cIAAAAASUVORK5CYII=" rel="icon" type="image/x-icon" />
@ritec
ritec / import_job.rb
Created June 4, 2019 18:07 — forked from madebydna/import_job.rb
Nested Batch workflow with Sidekiq Pro
class ImportJob
include Sidekiq::Worker
sidekiq_options :queue => :import, :retry => false, :backtrace => true
def perform(project_id)
# create master batch
a = Sidekiq::Batch.new
a.description = "Master Batch A"
a.on(:success, "ImportJob#on_success", {"step" => "a"})
logger.info "Master Batch A starting #{a.bid}"
@ritec
ritec / libreadline_6_not_found.sh
Last active March 25, 2019 20:58 — forked from wbotelhos/libreadline_6_not_found.sh
Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError)
ln -s /usr/local/opt/readline/lib/libreadline.7.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib
# or if the error is with dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib
ln -s /usr/local/opt/readline/lib/libreadline.8.0.dylib /usr/local/opt/readline/lib/libreadline.7.dylib
@ritec
ritec / 01_thread.rb
Created March 8, 2018 01:58 — forked from rsim/01_thread.rb
Code examples from my "Using threads in Ruby applications" presentation in our local Ruby meetup http://www.meetup.com/ruby-on-rails-latvia/events/105142132/
Thread.new do
sleep 5
puts "finished"
end
thread = Thread.new do
sleep 5
puts "finished"
end
thread.join
@ritec
ritec / sidekiq_monitoring
Created February 28, 2018 16:45 — forked from ngsmrk/sidekiq_monitoring
Sidekiq queue checking via rails console
stats = Sidekiq::Stats.new
stats.queues
stats.enqueued
stats.processed
stats.failed