Skip to content

Instantly share code, notes, and snippets.

莊喬 bootleq

Block or report user

Report or block bootleq

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
bootleq / vagrant.log
Last active Jun 16, 2018
@hashicorp/vagrant/#9941: Debug output of `VAGRANT_LOG=debug VAGRANT_POWERSHELL_VERSION_DETECTION_TIMEOUT=2 vagrant status`
View vagrant.log
INFO global: Vagrant version: 2.1.1
INFO global: Ruby version: 2.4.4
INFO global: RubyGems version:
INFO global: VAGRANT_EXECUTABLE="C:\\HashiCorp\\Vagrant\\embedded\\gems\\2.1.1\\gems\\vagrant-2.1.1\\bin\\vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="C:\\HashiCorp\\Vagrant\\embedded"
INFO global: VAGRANT_LOG="debug"
bootleq / awesome_print.rb
Created Feb 8, 2018
Change certain classes' `ap` (awesome_print) display
View awesome_print.rb
module AwesomePrint
# Make awesome_print aware of certain classes and format differently
module YourName
def self.included(base)
base.send :alias_method, :cast_without_your_name, :cast
base.send :alias_method, :cast, :cast_with_your_name
def cast_with_your_name(object, type)
cast = cast_without_your_name(object, type)
bootleq / .pryrc
Created Feb 8, 2018
Pry `db-exec` command
View .pryrc
if defined?(ActiveRecord::Base)
Pry::Commands.create_command 'db-exec' do
description 'Run SQL statement with ActiveRecord::Base.connection'
banner <<-BANNER
Usage: db-exec [ > OUTPUT ] STATEMENT
db-exec [ > OUTPUT ] < INPUT
db-exec < INPUT > OUTPUT
bootleq / .tmux-in.rb
Created Feb 28, 2016
Script to serve Tmux `copy-pipe` input
View .tmux-in.rb
#!/usr/bin/env ruby
type = ARGV.shift
# Support both ARGV (normal argument) and ARGF (tmux copy-pipe)
arg = ARGV.any? ? ARGV.join(' ') :
case type
bootleq / xhtml.html
Created Oct 5, 2015
Example file for testing webapi.vim xml#parse
View xhtml.html
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "">
<html xmlns="">
<title>TEST XML PARSER</title>
bootleq /
Created Oct 4, 2015
Install tig from source
if which apt-get 2>&1 >/dev/null; then
[[ -z $(dpkg --get-selections | grep libncursesw5-dev) ]] && sudo apt-get install -y libncursesw5-dev
elif which brew 2>&1 >/dev/null; then
brew install tig --with-docs
bootleq /
Created Sep 15, 2015
Install git from source
if which apt-get 2>&1 >/dev/null; then
sudo apt-get install -y libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev
cd ~/src
[[ ! -d git ]] && git clone --depth 10
bootleq / .zshrc
Last active Aug 29, 2015
Find ssh-agent and do ssh-add if needed
View .zshrc
sshAgentFind() {
# Ref
local -a sockets
if [[ -z "$SSH_AUTH_SOCK" ]] ; then
sockets=("${(@f)$(find /tmp/ -type s -path '/tmp/ssh-*/agent.*' -user $USER)}")
for socket in $sockets; do
SSH_AUTH_SOCK=$socket ssh-add -l 2> /dev/null > /dev/null
if [[ $? -eq 0 ]]; then
export SSH_AUTH_SOCK=$socket
bootleq / quickrun-as-sql-client.vim
Created Jun 12, 2015
Use vim-quickrun as SQL client
View quickrun-as-sql-client.vim
" First, install thinca/vim-quickrun
" Then write some vimrc:
bootleq / .zshrc
Created Sep 1, 2014
zsh function to restart Rails server (only support nginx server with passenger or unicorn_rails)
View .zshrc
rtouch() {
emulate -L zsh
if [[ -d tmp ]]; then
if which passenger 2>&1 >/dev/null; then
touch tmp/restart.txt && echo 'file touched.'
elif which unicorn_rails 2>&1 >/dev/null; then
if [[ -r tmp/pids/ && -n $(ps h -p `cat tmp/pids/` | tr -d ' ') ]]; then
kill -USR2 $(cat tmp/pids/ && echo "process killed."
elif [[ -f config/unicorn.rb ]] && [[ -n $RAILS_ENV ]]; then
bundle exec unicorn_rails -D -E $RAILS_ENV -c config/unicorn.rb && echo "process started."
You can’t perform that action at this time.