Skip to content

Instantly share code, notes, and snippets.

View diasjorge's full-sized avatar
🤖

Jorge Dias diasjorge

🤖
View GitHub Profile
class AWS::S3::S3Object
def self.rename_object(from, to, bucket)
old_acl_policy = acl(from, bucket)
put(path!(bucket, to), "x-amz-copy-source" => path!(bucket, from))
acl(to, bucket, old_acl_policy)
delete(from, bucket)
end
end
; Basic Drush Make file
; See the Drush Make prject page for info:
; http://drupal.org/project/drush_make
; This file by Brock Boland [[email protected]]
;
; This file is also on GitHub:
; http://gist.github.com/404528
; Core version
; ------------
@diasjorge
diasjorge / single_dep.rb
Created February 4, 2011 12:59
Drupal deployment strategy
# Requirements
# - You need drush installed on your project
# Current Features:
# - Revert all features
# - Backup database prior to deploy
# - Handle sites/default/files across releases
# - Clear cache
# TODO:
# - Automatic database updates
namespace :db do
desc "Download DB dump"
task :pull, :roles => :db, :once => true do
Capistrano::CLI.ui.say("You are about to import the DB from the #{stage} server")
agree = Capistrano::CLI.ui.agree("Continue (Yes, [No]) ") do |q|
q.default = 'n'
end
exit unless agree
@diasjorge
diasjorge / .bash_extensions
Created March 17, 2011 08:40
cd command with autocomplete
ideupdir="/home/boston/development/ideup"
function cdi() {
dir="$ideupdir"
if [ -n $1 ]; then
dir="$dir/$1"
fi
cd $dir
}
@diasjorge
diasjorge / scrapper.diff
Created March 20, 2011 22:14
Diff for the scrapper on agora on rails
diff --git a/lib/scrapper.rb b/lib/scrapper.rb
index 9009173..eac21bf 100644
--- a/lib/scrapper.rb
+++ b/lib/scrapper.rb
@@ -1,44 +1,59 @@
# coding: utf-8
class Scrapper
-
+
def self.scrape
diff --git a/rinari.el b/rinari.el
index f74494b..febdd5f 100644
--- a/rinari.el
+++ b/rinari.el
@@ -195,10 +195,15 @@ argument allows editing of the test command arguments."
(or (string-match "test" (or (ruby-add-log-current-method)
(file-name-nondirectory (buffer-file-name))))
(rinari-find-test))
- (let* ((funname (ruby-add-log-current-method))
+ (let* ((funname (rinari-test-function-name))
(defun rinari-test (&optional edit-cmd-args)
"Test the current ruby function. If current function is not a
test, then try to jump to the related test using
`rinari-find-test'. Dump output to a compilation buffer allowing
jumping between errors and source code. With optional prefix
argument allows editing of the test command arguments."
(interactive "P")
(or (string-match "test" (or (ruby-add-log-current-method)
(file-name-nondirectory (buffer-file-name))))
(rinari-find-test))
@diasjorge
diasjorge / gist:1077692
Created July 12, 2011 09:40
.rvmrc example
#!/usr/bin/env bash
# This is an RVM Project .rvmrc file, used to automatically load the ruby
# development environment upon cd'ing into the directory
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
environment_id="ruby-1.9.2-p180-patched@something"
#
# First we attempt to load the desired environment directly from the environment
@diasjorge
diasjorge / test_rubies
Created August 24, 2011 16:07
test_rubies
#!/usr/bin/env bash
RUBIES="ruby-1.8.7-skaes,ruby-1.9.2,rbx,jruby"
if [ -n $1 ]; then
RUBIES=${RUBIES//,/$1,}
RUBIES="$RUBIES$1"
fi
set -o verbose