View hello_world.rb
# gem install bundler
# ruby hello_world.rb
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'rails', '~> 5.0'
end
View gist:9218315

Keybase proof

I hereby claim:

  • I am trevorturk on github.
  • I am trevorturk (https://keybase.io/trevorturk) on keybase.
  • I have a public key whose fingerprint is BA9B A8C7 03A5 30E5 6B72 D928 E0F5 751D 09A6 0511

To claim this, I am signing this object:

View gist:5516046
desc "Insert an additional, separate set of fixtures from db/seeds"
task :seed_fixtures => :environment do
require 'active_record/fixtures'
files = "#{Rails.root}/db/seeds/*.yml"
connection = ActiveRecord::Base.connection
fixtures = Dir[files].collect do |file|
extname = File.extname(file)
name = File.basename(file).chomp(extname)
View gists.rb
# gem install httparty
# ruby gists.rb
require 'httparty'
class Gists
include HTTParty
@username = 'x'
@password = 'x'
View import_attachment_basecamp.rb
require 'faraday'
require 'faraday_middleware'
url_project = 'https://ciblonet.basecamphq.com'
project_id = 3684800
user_name = 'shingara'
password = 'xxxx'
class Attachment
View current.rb
# concerns#current
module Current
extend ActiveSupport::Concern
...
def current_kase
@current_kase ||= Kase.find_by_id(params[:kase_id])
end
# To include methods in views
View emoji.txt
2139 ℹ INFORMATION SOURCE
23EB ⏫ BLACK UP-POINTING DOUBLE TRIANGLE
23EC ⏬ BLACK DOWN-POINTING DOUBLE TRIANGLE
23F0 ⏰ ALARM CLOCK
23F3 ⏳ HOURGLASS WITH FLOWING SAND
26C5 ⛅ SUN BEHIND CLOUD
26D4 ⛔ NO ENTRY
2705 ✅ WHITE HEAVY CHECK MARK
2753 ❓ BLACK QUESTION MARK ORNAMENT
2757 ❗ HEAVY EXCLAMATION MARK SYMBOL
View gist:1756760
<!DOCTYPE html>
<html>
<head>
<title>title</title>
</head>
<body>
<p>body</p>
</body>
</html>
View gist:1232220
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>
View gist:981743
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}