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
/* | |
HTML Tidy Macro for Komodo Edit | |
Pipes tidy output through sed to convert space indentation to tabs (tidy doesn't support tab indentation). | |
Requires that tidy and sed be installed. | |
BSD License | |
*/ | |
komodo.assertMacroVersion(3); | |
if (komodo.view) { komodo.view.setFocus(); } |
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 | |
# Example usage | |
# | |
# $ explode dir/ | |
find "$*" -maxdepth 1 -mindepth 1 -exec mv -f {} "$*/../" \; | |
rmdir "$*" |
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
# Wrapper for ssh to automatically source bash config file on remote machine. | |
# Sources ~/.bashrc_remote | |
# | |
# author Jonah Dahlquist | |
# license CC0 | |
sshs() { | |
ssh ${*:1} "cat > /tmp/.bashrc_temp" < ~/.bashrc_remote | |
ssh -t ${*:1} "bash --rcfile /tmp/.bashrc_temp ; rm /tmp/.bashrc_temp" | |
} |
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
# Quickly `cd` relative to a specific directory | |
# | |
# author Jonah Dahlquist | |
# license CC0 | |
# Path to projects directory | |
export JUMP_PATH=$HOME/Projects | |
# Change to directory relative to JUMP_PATH | |
p() { |
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
# Easily generate a safe password. Defaults to 16 characters | |
# | |
# author Jonah Dahlquist | |
# license CC0 | |
genpass() { | |
local l=$1 | |
[ "$l" == "" ] && l=16 | |
tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs | |
} |
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
# Compress and archive project directory. Only deletes project directory if compression is successful. | |
# | |
# author Jonah Dahlquist | |
# license CC0 | |
export PROJECTS_PATH=~/Projects | |
parchive() { | |
local project=$1 | |
local year=`date +%Y` |
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 | |
provider=virtualbox | |
# Loop over boxes | |
for box in ~/.vagrant.d/boxes/*; do | |
# Create provider directory to contain files | |
mkdir $box/$provider/ |
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
# Copyright 2013 Jonah Dahlquist | |
# Creative Commons Attribution 3.0 | |
# | |
# Installation: | |
# Add to your spec_helper.rb file: | |
# Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } | |
# Add this file to spec/support/matchers/ | |
# | |
# Usage: | |
# it { should have_friendly_id :title } |
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
# Create a new, empty file if it does not exist. Creates parent directories if necessary. | |
# | |
# author Jonah Dahlquist | |
# license CC0 | |
punch() { | |
mkdir -p $(dirname $1) | |
touch $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
# Create a new, empty file if it does not exist. Creates parent directories if necessary. | |
# | |
# author Jonah Dahlquist | |
# license CC0 | |
rrgrep() { | |
if hash zeus 2>/dev/null; then | |
zeus rake routes | grep $@ | |
else | |
rake routes | grep $@ |
OlderNewer