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
# SpinaCMS will inject image URLs into the Trix content with the host:port as part of the URL | |
# This makes it hard to port that DB content to another host (say move from localhost to a production or staging site) | |
# load this patch from the config/application.rb like so:https://guides.rubyonrails.org/engines.html#overriding-models-and-controllers | |
Spina::ImagesHelper.class_eval do | |
def embedded_image_url(image) | |
return "" if image.nil? | |
main_app.polymorphic_path(image.variant(resize: Spina.config.embedded_image_size), only_path: true) | |
end | |
end |
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 | |
sudo find /usr/local/rvm/gems/ruby-1.9.2-p290/gems/spork-0.9.0 -name "*.rb" -exec chmod go+r {} \; | |
sudo find /usr/local/rvm/gems/ruby-1.9.2-p290/gems/spork-0.9.0 -name "spork" -exec chmod g+r {} \; | |
sudo find /usr/local/rvm/gems/ruby-1.9.2-p290/gems/spork-0.9.0 -type d -exec chmod go+rx {} \; | |
sudo chmod -R g+rw /usr/local/rvm/gems/ruby-1.9.2-p290/gems | |
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
desc "Generate a JavaScript file that contains your Rails routes" | |
namespace :js do | |
task :routes, [:filename] => :environment do |t, args| | |
filename = args[:filename].blank? ? "rails_routes.js" : args[:filename] | |
save_path = "#{Rails.root}/app/assets/javascripts/#{filename}" | |
routes = generate_routes_for_rails_3 | |
javascript = "" | |
routes.each do |route| | |
javascript << generate_method(route[:name], route[:path]) + "\n" |
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
unbind C-b | |
set -g prefix C-a | |
# resize panes with VIM nav keys | |
bind -r C-h resize-pane -L | |
bind -r C-j resize-pane -D | |
bind -r C-k resize-pane -U | |
bind -r C-l resize-pane -R | |
# faster tmux escape wait times? |
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
RSpec.configure do |config| | |
config.filter_run_excluding :remote => true | |
config.before :each, :remote => true do | |
# Configure code to hit the Braintree service | |
end | |
end | |
# Include your remote specs within your "normal" specs | |
describe Sweeper do |
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
root=Dir.pwd | |
puts ">>> Serving: #{root}" | |
run Rack::Directory.new("#{root}") | |
# using thin: | |
# thin -R static.ru start |
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 | |
echo "deb http://apt.opscode.com/ `lsb_release -cs`-0.10 main" | sudo tee /etc/apt/sources.list.d/opscode.list | |
sudo mkdir -p /etc/apt/trusted.gpg.d | |
gpg --keyserver keys.gnupg.net --recv-keys 83EF826A | |
gpg --export [email protected] | sudo tee /etc/apt/trusted.gpg.d/opscode-keyring.gpg > /dev/null | |
sudo apt-get update | |
sudo apt-get install opscode-keyring # permanent upgradeable keyring | |
sudo apt-get upgrade | |
sudo apt-get install chef chef-server |
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
curl --silent http://example.com/images/loggedout/ | grep "a href" | grep png | cut -d ' ' -f 8 | cut -d '=' -f 2 | cut -d '"' -f 2 | sed "s/^/http:\/\/example.com\/images\/loggedout\//" | xargs wget |
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
# change the hardstatus settings to give an window list at the bottom of the | |
# screen, with the time and date and with the current window highlighted | |
startup_message off | |
hardstatus alwayslastline | |
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]' | |
# terminfo and termcap for nice 256 color terminal | |
# allow bold colors - necessary for some reason | |
attrcolor b ".I" |
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
let &t_Co=256 | |
set number | |
set tabstop=2 | |
set shiftwidth=2 | |
set expandtab | |
set background=dark | |
syntax on | |
set ff=unix | |
set autoindent | |
set smartindent |