Skip to content

Instantly share code, notes, and snippets.

@thiensubs
thiensubs / .ruby-version
Last active July 25, 2020 06:16 — forked from janko/Gemfile
Memory profiling of http.rb and other popular Ruby HTTP client libraries
2.6.6
@thiensubs
thiensubs / deploy.rb
Last active May 24, 2019 01:28 — forked from yanyingwang/deploy.rb
mina+puma+nginx
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv' # for rbenv support. (http://rbenv.org)
# require 'mina/rvm' # for rvm support. (http://rvm.io)
require 'mina/puma'
require 'mina/nginx'
require 'mina_sidekiq/tasks'
# Basic settings:
@thiensubs
thiensubs / linked_link.rb
Last active April 11, 2019 15:31
This is ruby code implement for single linked list (List in DSA - data structures and algorithms)
@thiensubs
thiensubs / clear-sidekiq-jobs.sh
Created February 6, 2018 06:30 — forked from wbotelhos/clear-sidekiq-jobs.sh
Clear Sidekiq Jobs
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
# 3. Clear 'Processed' and 'Failed' jobs
@thiensubs
thiensubs / default.vcl.pl
Created August 21, 2017 03:35 — forked from bmarini/default.vcl.pl
A good varnish config for a Rails app
# https://www.varnish-cache.org/docs/2.1/tutorial/vcl.html
# https://www.varnish-cache.org/trac/wiki/VCLExamples
# Summary
# 1. Varnish will poll the backend at /health_check to make sure it is
# healthy. If the backend goes down, varnish will server stale content
# from the cache for up to 1 hour.
# 2. Varnish will pass X-Forwarded-For headers through to the backend
# 3. Varnish will remove cookies from urls that match static content file
# extensions (jpg, gif, ...)