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 / widget.html
Created September 7, 2023 21:06
Zendesk Widget
<script id="ze-snippet" src="https://static.zdassets.com/ekr/snippet.js?key=4cee5b4f-da79-4cae-891a-4efa9d5fa1de"> </script>
@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 / drum_sampler_samples_converter.sh
Last active August 24, 2020 14:29
Change format of Audio for Erica Synths Drum Sampler
rmdir ../temp #if there's a temp dir, let's remove it
mkdir ../temp #now make a new temp dir
find . -type d -print0 | while read -d $'\0' subdir; #find all subdirectories
do echo $subdir; mkdir ../temp/${subdir// /}; #and recreate them in the temp dir
done
find . -name "*.wav" -print0 | while read -d $'\0' file; #find all *.wav files to convert
do echo $file; # for each file found
/Users/rcaragol/Downloads/sox-14.4.2/sox -G "$file" --norm=-1 -b 16 -r 48k -c 1 ../temp/${file// /}; #convert to temp directory and remove spaces from filename
done
@ritec
ritec / Performance
Created January 9, 2020 21:58
Some Ruby on Rails Performance measuring tools
https://github.com/SamSaffron/memory_profiler
https://github.com/schneems/get_process_mem
https://github.com/ruby-prof/ruby-prof
https://ruby-prof.github.io/
@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}"