In newer versions of chrome you may not be able to just drag the code to your quick shortcuts. As a workaround you can just do:
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
# Temporarily redirects STDOUT and STDERR to /dev/null | |
# but does print exceptions should there occur any. | |
# Call as: | |
# suppress_output { puts 'never printed' } | |
# | |
def suppress_output | |
original_stderr = $stderr.clone | |
original_stdout = $stdout.clone | |
$stderr.reopen(File.new('/dev/null', 'w')) | |
$stdout.reopen(File.new('/dev/null', 'w')) |
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
#!/usr/bin/python3 | |
import logging | |
import os | |
import subprocess | |
import sys | |
from typing import Literal | |
logging.basicConfig(level=logging.DEBUG) |
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
#!/bin/bash | |
# echoes '#!/bin/bash xdg-open "$1" &> $HOME/.xdg-open-error &' to /usr/sbin/open | |
echo -e "\043\041/bin/bash\n\nxdg-open \042\044\061\042 &> $HOME/.xdg-open-error &" > ozanmuyes-open | |
sudo mv ozanmuyes-open /usr/sbin/open | |
sudo chmod +x /usr/sbin/open | |
echo -e "\n# Mac OSX \047open\047 equivalent for Debian\nalias 'open'='/usr/sbin/open'" >> $HOME/.zshrc | |
. $HOME/.zshrc |
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
#!/usr/bin/env ruby | |
# Validates that you don't commit forbidden keywords to the repo | |
# You can skip this checking with 'git commit --no-verify' | |
exit 0 if ARGV.include?('--no-verify') | |
# Update this list with your own forbidden keywords | |
KEYWORDS = %w(binding.pry console.log debugger) | |
def red(text) "\033[31m#{text}\033[0m"; end |