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
# from http://github.com/ng/paperclip-watermarking-app | |
# with modifications from http://exviva.posterous.com/watermarking-images-with-rails-3-and-papercli | |
# and even more modifications to ensure works with paperclip 2.3.8 and rails 3.0.3 | |
# | |
# Note: In rails 3 paperclip processors are not automatically loaded. | |
# You must add the following above your model class definition: | |
# | |
# require 'paperclip_processors/watermark' | |
module Paperclip |
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
" Plugin: pathogen.vim: manage your runtimepath | |
call pathogen#infect() | |
filetype plugin indent on | |
set showcmd " Show (partial) command in status line. | |
set showmatch " Show matching brackets. | |
set ignorecase " Do case insensitive matching | |
"set smartcase " Do smart case matching | |
set incsearch " Incremental search |
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 | |
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"` | |
echo "Checking PHP Lint..." | |
FILES="" | |
for FILE in `git diff --cached --name-only --diff-filter=ACMR HEAD | egrep \\\\.\(php\|ctp\)\$` | |
do | |
php -l -d display_errors=0 $PROJECT/$FILE | |
if [ $? != 0 ] |
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 | |
DATA=`date +%Y%m%d-%H%M` | |
DUMP=/usr/bin/mysqldump | |
MYSQLDIR='cd /tmp/bkp' | |
TAR=/bin/tar | |
$DUMP -uroot -p123 --all-databases > /tmp/bkp/mysql.bkp_$DATA | |
$MYSQLDIR |
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 | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
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
set -g status-left-length 32 | |
set -g status-right-length 150 | |
set -g status-fg white | |
set -g status-bg colour234 | |
set -g window-status-activity-attr bold | |
set -g pane-border-fg colour245 | |
set -g pane-active-border-fg colour39 | |
set -g message-fg colour16 | |
set -g message-bg colour221 |
NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
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
class ApplicationController < ActionController::Base | |
before_filter :ensure_xhr | |
private | |
def ensure_xhr | |
if request.get? && request.format && (request.format.js? || request.format.json?) | |
head :forbidden unless request.xhr? | |
end | |
end | |
end |
OlderNewer