This file contains hidden or 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 'growl' | |
module Jekyll | |
class GrowlPreHook < Hook | |
safe false | |
sequence :pre | |
def run(site) | |
Growl.notify 'Building...', :title => 'Jekyll' | |
end |
This file contains hidden or 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
# ZSH | |
sudo add-apt-repository ppa:XXXXXXXX - to add repository | |
se /etc/apt/sources.list - where to add repositories manually | |
rm /var/lib/apt/lists/XXXXX - another place where repositories are kept | |
chown -R www-data /usr/share/wordpress - to change the owner of a file, recursively | |
df -h - to check the size of the disk and % used! | |
ps aux - to see all of the running processes! | |
grep -v XXXXX - sort a file but skip any line that has XXXXX on it | |
dig +short - to see the IP of a web site | |
apt-get install <package-name>=<version> - to install a specific version of a package |
This file contains hidden or 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
cd <destination> | |
mv <source>/.git ./.git | |
git config core.worktree /absolute/path/to/project-files |
This file contains hidden or 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/zsh | |
#^jist /home/coda/Dropbox/bootstrap -u 4950102 | |
if [ ! -d ~/Dropbox/Dot-Files ]; then | |
mkdir Dropbox/Dot-Files/ | |
fi | |
if [ ! -d ~/Dropbox/Camera\ Uploads ]; then | |
mkdir Dropbox/Camera\ Uploads/ | |
fi |
This file contains hidden or 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/zsh | |
rvm use default@global | |
cd ~/Dropbox/Rvm-Gems | |
gemfiles=("${(@f)$(ls /home/coda/Dropbox/Rvm-Gems)}") | |
IFS='.' | |
for f in $gemfiles[@]; do | |
gems=($(echo $f)) | |
rvm gemset use $gems[1] --create | |
rvm gemset import $gems[1] |
This file contains hidden or 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/zsh | |
dump_data=$(pdftk $1 dump_data | grep NumberOfPages:) | |
base_name=$(echo $1 | sed -E 's/(.*).pdf(.*)/\1/') | |
number_pages=$(echo $dump_data | sed -E 's/(.*): (.*)/\2/') | |
((splits = $number_pages / 10)) | |
((do_end = $number_pages % 10)) | |
start=1 | |
stop=10 | |
for ((i=0; i < $splits; i++)); do |
This file contains hidden or 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
(row,col) = self.view.rowcol(self.view.sel()[0].begin()) | |
target = self.view.text_point(row, col-1) | |
self.view.sel().clear() | |
self.view.sel().add(sublime.Region(target)) | |
self.view.show(target) |
This file contains hidden or 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
[merge "railsschema"] | |
name = newer Rails schema version | |
driver = "ruby -e '\n\ | |
system %(git), %(merge-file), %(--marker-size=%L), %(%A), %(%O), %(%B)\n\ | |
b = File.read(%(%A))\n\ | |
b.sub!(/^<+ .*\\nActiveRecord::Schema\\.define.:version => (\\d+). do\\n=+\\nActiveRecord::Schema\\.define.:version => (\\d+). do\\n>+ .*/) do\n\ | |
%(ActiveRecord::Schema.define(:version => #{[$1, $2].max}) do)\n\ | |
end\n\ | |
File.open(%(%A), %(w)) {|f| f.write(b)}\n\ | |
exit 1 if b.include?(%(<)*%L)'" |
This file contains hidden or 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
db/schema.rb merge=railsschema |
This file contains hidden or 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 | |
function install_a_bunch() { | |
PKGS_INST=( ) | |
for pkg in $1; do | |
CAN_WE_FIND_IT=`sudo apt-get -qq --dry-run install $pkg` | |
if [ ! "$CAN_WE_FIND_IT" == 100 ]; then | |
IS_IT_THERE=`dpkg -l | grep $pkg` | |
if [[ ! "$IS_IT_THERE" ]]; then | |
PKGS_INST=( "${PKGS_INST[@]}" "${pkg}" ) | |
fi |
OlderNewer