Skip to content

Instantly share code, notes, and snippets.

View backpackerhh's full-sized avatar
🏠
Working from home

David Montesdeoca backpackerhh

🏠
Working from home
View GitHub Profile
@jgillman
jgillman / restore.sh
Last active May 20, 2024 19:56
pg_restore a local db dump into Docker
# Assumes the database container is named 'db'
DOCKER_DB_NAME="$(docker-compose ps -q db)"
DB_HOSTNAME=db
DB_USER=postgres
LOCAL_DUMP_PATH="path/to/local.dump"
docker-compose up -d db
docker exec -i "${DOCKER_DB_NAME}" pg_restore -C --clean --no-acl --no-owner -U "${DB_USER}" -d "${DB_HOSTNAME}" < "${LOCAL_DUMP_PATH}"
docker-compose stop db
@staltz
staltz / introrx.md
Last active May 20, 2024 14:59
The introduction to Reactive Programming you've been missing
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 20, 2024 12:37
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 19, 2024 11:31
set -e, -u, -o, -x pipefail explanation
@ronaldsuwandi
ronaldsuwandi / tmux.conf
Last active May 17, 2024 06:47
Personal tmux.conf (updated for 3.2)
###########
# general #
###########
# Replace C-b prefix with Alt+Space (so it won't clash with vim)
unbind C-b
set-option -g prefix M-Space
set-window-option -g mode-keys vi
# set-option -g default-shell /usr/local/bin/fish
@ericelliott
ericelliott / essential-javascript-links.md
Last active May 17, 2024 03:38
Essential JavaScript Links
@thiagoa
thiagoa / linux-usb-file-copy-fix.md
Created November 3, 2021 01:14 — forked from 2E0PGS/linux-usb-file-copy-fix.md
Fix Ubuntu and other Linux slow/hanging file copying via USB.

If your running a x64 bit Ubuntu or other Linux and find USB transfers hang at the end apply this fix:

echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes
echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes

I suggest you edit your /etc/rc.local file to make this change persistant across reboots.

sudo nano /etc/rc.local

@mlanett
mlanett / rails http status codes
Last active May 14, 2024 08:48
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@JunichiIto
JunichiIto / alias_matchers.md
Last active May 14, 2024 08:48
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
@ardecvz
ardecvz / vcr_intro.rb
Last active May 14, 2024 08:22
A VCR trick to include preparation and cleanup phases for external services directly within the test files (the phases run ONLY when recording cassettes)
# frozen_string_literal: true
# A VCR trick to include preparation and cleanup phases for external services
# directly within the test files (the phases run ONLY when recording cassettes):
#
# RSpec.describe EvilMartiansAPI::Client, vcr: true do
# let(:client) { described_class.new }
#
# let(:developer_team_number) { 42 }
#