Skip to content

Instantly share code, notes, and snippets.

View Overload119's full-sized avatar
🎯
Focusing

Amir Sharif Overload119

🎯
Focusing
View GitHub Profile
@Overload119
Overload119 / amazon_product.json
Created November 7, 2022 02:05
amazon_product.json
{
"products": {
"B00NQLE5JC": {
"asin": "B00NQLE5JC",
"gtin": "702534568468",
"link": "https://www.amazon.com/Premium-Powdered-Peanut-Butter-Farms/dp/B00NQLE5JC",
"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
Overload119 / debug.rb
Last active July 16, 2022 04:06
kill -TTIN sidekiq
# 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-7.0.2.4/lib/active_record/connection_adapters/abstract/connection_pool/reaper.rb:46:in `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'
2022-0
@Overload119
Overload119 / gdb output
Created July 14, 2022 22:36
Sidekiq stuck worker traces
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/libpthread.so.0
#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
@Overload119
Overload119 / response.json
Last active June 1, 2022 17:58
Typical response from Facebook Ad Library Async Request
{
"__ar": 1,
"payload": {
"isResultComplete": false,
"results": [
[
{
"adid": "0",
"adArchiveID": "496684318922746",
"archiveTypes": [
@Overload119
Overload119 / gist:1e70200e9b674ebde6cfd7d3978524b3
Created March 27, 2021 15:47
What Canvas-like library does Bannerbear.com use?
https://konvajs.org/
@Overload119
Overload119 / Using ffmpeg to reduce background nois.md
Last active January 25, 2021 01:04
Using ffmpeg to reduce background nois.md

Scenario:

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
## File
```yaml
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
Overload119 / close_port.rb
Last active February 28, 2021 22:56
Installation:
#!/usr/bin/env ruby
# Synced on Dropbox.
# Synced on https://gist.github.com/Overload119/3cecbf8391d8bb7af635a608c0367e8e
# 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|
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>http://localhost:3000</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>DELETE</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
@Overload119
Overload119 / Overload - Contributions.md
Created January 26, 2019 19:56
How to contribute to my projects.

Feature Workflow

You want to "branch"

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