Skip to content

Instantly share code, notes, and snippets.

View cedricdekimpe's full-sized avatar

Cédric Dekimpe cedricdekimpe

View GitHub Profile
@cedricdekimpe
cedricdekimpe / gallery_images_controller.rb
Created August 20, 2011 12:27 — forked from splendeo/gallery_images_controller.rb
libpaperclip_processorsrotator.rb:6 : rotate_command to array to avoid "Can't convert String into Array" error
fr:
date:
abbr_day_names:
- dim
- lun
- mar
- mer
- jeu
- ven
- sam
@cedricdekimpe
cedricdekimpe / application.js
Created May 29, 2012 09:27
How-to override window.confirm() dialog with Rails 3 and bootbox.js
//= require bootbox.min
source 'http://rubygems.org'
gem 'rails', '3.2.1'
gem 'ruby-units'
gem "mysql2", "~> 0.3.2"
gem 'devise', '2.0.4'
gem 'cancan'
gem 'fastercsv' # used by rails_admin
gem "rack"
gem "gravatar_image_tag", "1.0.0"
gem 'omniauth', "~> 1.0"
number:
format:
separator: ","
delimiter: " "
precision: 3
significant: false
strip_insignificant_zeros: false
currency:
format:
format: "%n %u"
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'capybara/rspec'
require 'rspec/autorun'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
# Load the rails application
require File.expand_path('../application', __FILE__)
require File.expand_path('../app_config.rb', __FILE__)
#config.active_record.default_timezone = "UTC"
#config.time_zone = "UTC"
ActionView::Base.field_error_proc = proc { |input, instance| input }
# source: http://codesnipr.com/snippet/1105/Rails-3-Removing-field-with-errors-division
(function(window, undefined) { "use strict";
var jQuery = window.alohaQuery || window.jQuery,
$ = jQuery, Aloha = window.Aloha;
Aloha.MetaView = new (Aloha.Plugin.extend({
_constructor: function(){
this._super('metaview');
},
/*** Configure the available languages*/
#!/bin/bash
bucket="BUCKETNAME"
expireweeks=3
databases=`mysql -e "SHOW DATABASES;" | tr -d "| " | grep -v "\(Database\|information_schema\|mysql\)"`
datestamp=`date +"%m-%d-%y"`
timestamp=`date +"%H%M%S"`
for db in $databases; do

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc