View my-linux-commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pg_dump -U postgres_user -h localhost -Fc database_name > dump.sql | |
pg_restore --verbose --clean --no-acl --no-owner -h localhost -d database_name ./path/db.sql |
View spotify selectors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getArtistName(currentTabId, callback) { | |
chrome.tabs.executeScript( | |
currentTabId, | |
{ code: `document.querySelector('.now-playing span a[href^="/artist/"]').innerText` }, | |
callback | |
); | |
} | |
getSongName(currentTabId, callback) { | |
chrome.tabs.executeScript( |
View puma.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Puma HTTP Server | |
After=network.target | |
# Uncomment for socket activation (see below) | |
# Requires=puma.socket | |
[Service] | |
# Foreground process (do not use --daemon in ExecStart or config.rb) | |
Type=simple |
View gist:6423d82128861b47fc18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Goliath | |
class Request | |
old_post_process = instance_method(:post_process) | |
define_method(:post_process) do |results| | |
status, headers, body = *results | |
# Include any data here | |
# All requests will pass here | |
if env['size-error'] |
View em-hiredis.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require 'em-hiredis' | |
rescue LoadError => error | |
raise 'Missing EM-Synchrony dependency: gem install em-hiredis' | |
end | |
module EventMachine | |
module Hiredis | |
def self.connect(uri = nil) |