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 | |
############################################################### | |
# # | |
# BibTeX (BibLaTeX) to LaTeX \bibitem converter # | |
# # | |
############################################################### | |
# # | |
# This script converts a file containing # | |
# BibTeX (BibLaTeX) entries to a list of \bibitems, # |
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/sh | |
SERVER=${1:-my.server.com} | |
PORT=${2:-993} | |
CERT_FOLDER=${3:-~/certs} | |
openssl s_client -connect ${SERVER}:${PORT} -showcerts 2>&1 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'| sed -ne '1,/-END CERTIFICATE-/p' > ${CERT_FOLDER}/${SERVER}.pem |
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/sh | |
# Should be placed in .git/hooks/pre-commit inside project dir | |
# Do not forget to install The Silver Search: https://github.com/ggreer/the_silver_searcher#linux | |
ag_output=$(ag --color "(:focus\b)|(^[^#\\n]+(byebug|binding\.pry))" `git diff-index --cached HEAD --no-commit-id --name-only | grep ".*rb$"` 2> /dev/null) | |
if [ $? == 0 ] | |
then | |
echo "There are undeleted :focus or breakpoint (byebug or pry-byebug) in following files:" | |
echo "$ag_output" | |
exit 1 |
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
require 'rspec/expectations' | |
RSpec::Matchers.define :be_observed_by do |observer_name| | |
match do |obj| | |
ActiveRecord::Base.observers.enable observer_name | |
observer = observer_class(observer_name) | |
# save old after_create and define new | |
was_defined = observer.method_defined?(:after_create) |
NewerOlder