Skip to content

Instantly share code, notes, and snippets.


Amir Sharif Overload119

View GitHub Profile
Overload119 / amazon_product.json
Created November 7, 2022 02:05
View amazon_product.json
"products": {
"B00NQLE5JC": {
"asin": "B00NQLE5JC",
"gtin": "702534568468",
"link": "",
"brand": "NAKED nutrition",
"title": "2 LB Powdered Peanut Butter from US Farms – Bulk, Only 1 Ingredient - Roasted Peanuts, Vegan, No Additives, Preservative Free, No Salt, No Sugar - 76 Servings - NAKED PB Peanut Butter 2 Pound (Pack of 1)",
"images": [
Overload119 / debug.rb
Last active July 16, 2022 04:06
kill -TTIN sidekiq
View debug.rb
# This is the same as the file below but only contains the first line of each thread.
2022-07-16T03:53:35.661Z pid=7924 tid=iok WARN: /Users/amirsharif/.rvm/gems/ruby-2.7.5/gems/sidekiq-6.5.1/lib/sidekiq/cli.rb:188:in `backtrace'
2022-07-16T03:53:35.661Z pid=7924 tid=iok WARN: /Users/amirsharif/.rvm/gems/ruby-2.7.5/gems/activerecord- `sleep'
2022-07-16T03:53:35.661Z pid=7924 tid=iok WARN: /Users/amirsharif/.rvm/gems/ruby-2.7.5/gems/timeout-0.3.0/lib/timeout.rb:105:in `pop'
2022-07-16T03:53:35.662Z pid=7924 tid=iok WARN: /Users/amirsharif/.rvm/gems/ruby-2.7.5/gems/appsignal-3.0.27/lib/appsignal/minutely.rb:146:in `sleep'
2022-07-16T03:53:35.662Z pid=7924 tid=iok WARN: /Users/amirsharif/.rvm/gems/ruby-2.7.5/gems/rack-mini-profiler-3.0.0/lib/mini_profiler/storage/file_store.rb:83:in `sleep'
2022-07-16T03:53:35.662Z pid=7924 tid=iok WARN: /Users/amirsharif/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/forwardable.rb:235:in `pop'
Overload119 / gdb output
Created July 14, 2022 22:36
Sidekiq stuck worker traces
View gdb output
This file has been truncated, but you can view the full file.
Thread 631 (Thread 0x7fd6f8a00700 (LWP 61224)):
#0 0x00007fd71db8400c in pthread_cond_wait@@GLIBC_2.3.2 () at /lib/x86_64-linux-gnu/
#1 0x00007fd71d9e1c79 in rb_native_cond_wait (cond=cond@entry=0x7fd706ab9b08, mutex=mutex@entry=0x7fd706ab9b60) at thread_pthread.c:509
#2 0x00007fd71d9e2f1d in native_cond_sleep (th=th@entry=0x7fd706ab9aa0, rel=rel@entry=0x0) at thread_pthread.c:1197
#3 0x00007fd71d9e2f9f in native_sleep (th=th@entry=0x7fd706ab9aa0, rel=rel@entry=0x0) at thread_pthread.c:2113
#4 0x00007fd71d9e568a in sleep_forever (th=0x7fd706ab9aa0, fl=fl@entry=1) at thread.c:1247
#5 0x00007fd71d9e56ec in rb_thread_sleep_deadly_allow_spurious_wakeup () at vm_core.h:1796
#6 0x00007fd71d9e56ec in rb_mutex_sleep_forever (time=time@entry=8) at thread_sync.c:451
#7 0x00007fd71d8b4644 in rb_ensure
Overload119 / response.json
Last active June 1, 2022 17:58
Typical response from Facebook Ad Library Async Request
View response.json
"__ar": 1,
"payload": {
"isResultComplete": false,
"results": [
"adid": "0",
"adArchiveID": "496684318922746",
"archiveTypes": [
Overload119 / gist:1e70200e9b674ebde6cfd7d3978524b3
Created March 27, 2021 15:47
What Canvas-like library does use?
Overload119 / Using ffmpeg to reduce background
Last active January 25, 2021 01:04
Using ffmpeg to reduce background
View Using ffmpeg to reduce background


I have a file I recorded. It has background noise I want to remove (fans, clicking, etc.) Works good for fans but a little less well for clicking.

  1. Extract the audio file from the video
ffmpeg -i <path> -vn -acodec copy output-audio.aac
View gist:1b37d43c08e97cd3d9dfa710ef56b5cd
## File
File › New: Cmd N
File › Open...: Cmd O
File › Open Folder...: none
File › Open Recent Folder...: Ctrl R
File › Save: Cmd S
File › Save As...: Cmd Shift S
File › Autosave: none
Overload119 / close_port.rb
Last active February 28, 2021 22:56
View close_port.rb
#!/usr/bin/env ruby
# Synced on Dropbox.
# Synced on
# cp ThisFile /usr/local/bin/close_port
running_apps = `lsof -i:#{ARGV[0]}`
return if running_apps.empty?
output_lines = running_apps.split("\n")
output_lines.drop(1).each do |line|
View gist:985ed67f775c6213a87c9d5a8f122878
Overload119 / Overload -
Created January 26, 2019 19:56
How to contribute to my projects.
View Overload -

Feature Workflow

You want to "branch"

git checkout master
git pull --rebase # sync your repo with
git checkout -b <yourbranchname> # create a branch and give it a unique name, usually after the feature (ie. "new-feature")