This file contains hidden or 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 -v -H 'Accept: application/xml' -F Filedata=@/path/to/file https://trevorturk.basecamphq.com/upload | |
curl -v -H 'Accept: application/xml' -H 'Content-Type: application/xml' -u TOKEN:X \ | |
-d " | |
<post> | |
<title>Test</title> | |
<body>Test</body> | |
<attachments> | |
<file> | |
<file>ID_FROM_FIRST_REQUEST</file> |
This file contains hidden or 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
diff --git a/lib/carrierwave/mount.rb b/lib/carrierwave/mount.rb | |
index 906aaae..be69639 100644 | |
--- a/lib/carrierwave/mount.rb | |
+++ b/lib/carrierwave/mount.rb | |
@@ -226,8 +226,19 @@ module CarrierWave | |
_mounter(:#{column}).write_identifier | |
end | |
- RUBY | |
+ def store_previous_model_for_#{column} |
This file contains hidden or 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
# usage: Given eval "@time = Time.now" | |
Given /^eval "([^"]*)"$/ do |code| | |
eval code | |
end |
This file contains hidden or 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
# config/initializers/email_logger.rb | |
class EmailLogger | |
def self.delivered_email(email) | |
EmailLog.create!( | |
:from => email.from, | |
:to => email.to, | |
:subject => email.subject, | |
:body => email.body.inspect, | |
:date => email.date | |
) |
This file contains hidden or 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
diff --git i/lib/carrierwave/uploader/download.rb w/lib/carrierwave/uploader/download.rb | |
index 123168b..5f39eae 100644 | |
--- i/lib/carrierwave/uploader/download.rb | |
+++ w/lib/carrierwave/uploader/download.rb | |
@@ -13,7 +13,7 @@ module CarrierWave | |
class RemoteFile | |
def initialize(uri) | |
- @uri = URI.parse(URI.escape(uri)) | |
+ @uri = uri |
This file contains hidden or 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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/' | |
} | |
export PS1="\w\$(parse_git_branch) > " |
This file contains hidden or 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
$(document).ready(function(){ | |
var focus = true; | |
var count = 0; | |
var title = document.title; | |
$(window).focus(function(){ | |
focus = true; | |
count = 0; | |
setTimeout(function(){ | |
document.title = title; |
This file contains hidden or 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
# config/initializers/delayed_job.rb | |
Delayed::Worker.destroy_failed_jobs = false | |
class Delayed::Worker | |
alias_method :original_handle_failed_job, :handle_failed_job | |
def handle_failed_job(job, error) | |
HoptoadNotifier.notify(error) | |
original_handle_failed_job(job, error) |
This file contains hidden or 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 "cache assets" | |
task :cache_assets => :environment do | |
paths = ['public/javascripts/all.js', 'public/stylesheets/all.css'] | |
puts "-----> caching assets..." | |
paths.each do |path| | |
puts "-----> #{path}" | |
end |
This file contains hidden or 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 'httparty' | |
task :pinboard do | |
class Pinboard | |
include HTTParty | |
base_uri 'https://api.pinboard.in/v1' | |
def initialize(auth) | |
@auth = auth |