Skip to content

Instantly share code, notes, and snippets.

Stephan Wehner stephan-buckmaster

Block or report user

Report or block stephan-buckmaster

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
stephan-buckmaster /
Created Dec 28, 2018
Bash extensions history/git/misc.
# Couple of bash extensions. Place at end of ~/.bashrc
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history.
export HISTCONTROL=ignoredups
# ... and ignore same sucessive entries.
export HISTSIZE=5000
View gettext-extract.rb
# Collapses Gettext po files. for easy diff'ing
# Drops comments, and collapses quotes into one line.
# Example of what a po-file is:
# Expanding the script by Raphaël Kolm at
# Sample output:
# 00001 msgid "is english def"
# 00001 msgstr "est anglais"
# 00002 msgid "good"
stephan-buckmaster / pre-commit
Created Jun 28, 2018
Pre-commit hook to remind committer to run rake-assets-precompile
View pre-commit
# if changed assets are being committed, prompt the user to confirm
# they have precompiled assets.
if test $(git diff --cached --name-only | grep app/assets | wc -l) != 0
# grab user input
exec < /dev/tty
View mysql-drop-databases.rb
# a ruby script
get_database_list_command = "mysql -u root -p -e 'show databases' | grep -v Database | grep -v 'information' | grep -v 'mysql'"
database_names = ` #{get_database_list_command} `.split(/\n/)
drop_databases_sql_statements = database_names.collect { |db| "drop database if exists `#{db}`;" if db.length > 0}.compact.join(' ')
puts 'Executing drop commands:'
puts drop_databases_sql_statements
puts drop_databases_sql_statements.split(/;/).join(";\n")
View html-attiny-url-com-html-source-of-this-tweet
<!DOCTYPE html>
<html data-nav-highlight-class-name="highlight-global-nav-home">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8" />
View tinyurl-com-sample-tweet-source
<!DOCTYPE html>
<html data-nav-highlight-class-name="highlight-global-nav-home">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8" />
You can’t perform that action at this time.