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
# Git hook to switch config files made for a Rails app | |
# Looks for config file named like the branch. | |
# | |
# i.e.: database.mybranch.yml | |
# | |
# If the file is found, copies that to the actual config | |
# overwriting the previous one. | |
# | |
# The third parameter is 1 when we are switching branches | |
# |
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 Asset | |
include MongoMapper::Document | |
plugin Joint | |
# Next time use '#' hash mark to crop images. i.e. #200x250 | |
Thumbs = { :detail => "440x300>", :medium => "220x150>", :little => "100x60>", :highlights => 'crop-200x250' } | |
attachment :file |
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 | |
# This script is supposed to be executed on the | |
# machine which hosts the database. | |
# | |
# What it does is to dump the entire database in | |
# separate directories, and then tgzip each single | |
# database. | |
# Example: |
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
require 'rubygems' | |
require 'mongo_mapper' | |
require 'joint' | |
require 'shoulda' | |
MongoMapper.database = 'joint_exif_test' | |
class Photo | |
include MongoMapper::Document |
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
#!/usr/bin/env ruby | |
# This script is a backup tool for mongodb. | |
# | |
# The main purpose is to dump files from gridfs to filesystem, | |
# to take advantage of backup solutions based on tools like | |
# rsync. | |
# Developed against mongo 1.6.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
require 'spec_helper' | |
describe Network::SearchController do | |
before do | |
request.env['HTTPS'] = 'on' | |
end | |
describe '#global' do | |
context 'anonymously' 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
# vim: ft=ruby | |
source :rubygems | |
gem 'eventmachine' | |
gem 'em-zeromq', :path => '~/Work/em-zeromq' | |
gem 'sinatra' | |
gem 'zmq' |
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 | |
# | |
# pre-commit hook, avoid committing :focus on rspec examples | |
focus=', :focus' | |
result=$(git grep -n $focus -- */**/*_spec.rb) | |
if [ "$result" != '' ]; then | |
echo "" | |
echo "Refusing to commit a :focus tag in specs: " | |
echo "" |
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
module PaperclipMongoidPatch | |
class << self | |
def obtain_class | |
class_name = ENV['CLASS'] || ENV['class'] | |
raise "Must specify CLASS" unless class_name | |
@klass = Object.const_get(class_name) | |
end | |
def obtain_attachments | |
name = ENV['ATTACHMENT'] || ENV['attachment'] |
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
#!/usr/bin/env bash | |
# Copy this file into the home directory of the sudoer | |
# user that will run all chef recipes. | |
sudo apt-get -y update | |
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev | |
sudo apt-get -y install rsync | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz |
OlderNewer