Skip to content

Instantly share code, notes, and snippets.

View cdesch's full-sized avatar
🏠
Working from home

cdesch cdesch

🏠
Working from home
View GitHub Profile
2016-04-20T17:24:53.739Z 20447 TID-owpsaw07w WARN: /Users/cj/RubymineProjects/revenue_management_system/app/models/prospect.rb:3:in `block in <class:Prospect>'
/Users/cj/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/public_activity-1.5.0/lib/public_activity/common.rb:14:in `resolve_value'
/Users/cj/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/public_activity-1.5.0/lib/public_activity/common.rb:315:in `prepare_relation'
/Users/cj/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/public_activity-1.5.0/lib/public_activity/common.rb:281:in `prepare_settings'
/Users/cj/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/public_activity-1.5.0/lib/public_activity/common.rb:250:in `create_activity'
/Users/cj/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/public_activity-1.5.0/lib/public_activity/actions/update.rb:14:in `activity_on_update'
/Users/cj/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:432:in `block in make_lambda'
/Users/cj/.rbenv/versions/2.3.0/lib/ruby/gems/
#Calc Change
#April 16 2016
puts "Hi this is my change calculator" #\n
print "Enter your bill: " # 21.32 # 21.353
#bill = gets
#bill = bill.chomp
#bill = bill.to_f
#bill = bill.round(2)
bill = gets.chomp.to_f.round(2)
#Calc Change
#April 16 2016
puts "Hi this is my change calculator" #\n
print "Enter your bill: " # 21.32 # 21.353
#bill = gets
#bill = bill.chomp
#bill = bill.to_f
#bill = bill.round(2)
bill = gets.chomp.to_f.round(2)
#OS X El Capitan 10.11.4
#Ruby 2.3.0
#Rails 4.2.6
#manual installation of the following gems when upgrading to ruby 2.3.0
gem install eventmachine -v '1.0.8' -- --with-cppflags=-I/usr/local/opt/openssl/include
#gem install libv8 -v '3.16.14.13' -- --with-system-v8
#brew install v8
@cdesch
cdesch / issue.rb
Created March 11, 2016 15:56
ActionView::MissingTemplate:
ActionView::MissingTemplate: Missing template front_page/index, application/index with {:locale=>[:en], :formats=>[:gif, "image/x-xbitmap", :jpeg, "image/pjpeg", "application/x-shockwave-flash", "application/vnd.ms-excel", "application/vnd.ms-powerpoint", "application/msword"], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :arb, :jbuilder]}. Searched in:
* "/app/app/views"
* "/app/vendor/bundle/ruby/2.0.0/gems/activeadmin-1.0.0.pre2/app/views"
* "/app/vendor/bundle/ruby/2.0.0/gems/kaminari-0.16.3/app/views"
* "/app/vendor/bundle/ruby/2.0.0/gems/devise-3.5.2/app/views"
File "/app/vendor/bundle/ruby/2.0.0/gems/actionview-4.2.4/lib/action_view/path_set.rb", line 46, in find
File "/app/vendor/bundle/ruby/2.0.0/gems/actionview-4.2.4/lib/action_view/lookup_context.rb", line 121, in find
File "/app/vendor/bundle/ruby/2.0.0/gems/actionview-4.2.4/lib/action_view/renderer/abstract_renderer.rb", line 18, in find_template
File "/app/vendor/bundle/ruby/2.0.0/gems/actionview-4.2.4/lib/ac
Installing bcrypt-ruby (2.1.4) with native extensions /usr/lib/ruby/1.9.1/rubygems/installer.rb:562:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:13:in `<main>'
Gem files will remain installed in /home/vagrant/.bundler/tmp/31895/gems/bcrypt-ruby-2.1.4 for inspection.
Results logged to /home/vagrant/.bundler/tmp/31895/gems/bcrypt-ruby-2.1.4/ext/mri/gem_make.out
Run: brew update
Fix permissions when you get this:
cjsMBP15:~ cj$ brew update
Error: The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. Some versions of the
"InstantOn" component of Airfoil or running Cocktail cleanup/optimizations
are known to do this.
@cdesch
cdesch / ShortenVideo.rb
Created September 16, 2015 19:20
Shorten all videos in a directory to a specified time using ffmpeg
puts 'Converting FLV files'
basedir = '.'
Dir.glob("*.mp4") do |my_text_file|
puts ' --> converting: ' + my_text_file
puts "ffmpeg -i #{my_text_file.gsub(/ /, '\ ')} -ss 00:00:00.0 -c copy -t 00:00:10.0 new.#{my_text_file.gsub(/ /, '\ ')}"
`ffmpeg -i #{my_text_file.gsub(/ /, '\ ')} -ss 00:00:00.0 -c copy -t 00:00:10.0 new.#{my_text_file.gsub(/ /, '\ ')}`
end
rails plugin new basic_calendar -T --mountable --dummy-path=spec/dummy && cd basic_calendar
Add
s.test_files = Dir["spec/**/*"]
#append rakefile
require 'rspec/core'
require 'rspec/core/rake_task'
desc "Run all specs in spec directory (excluding plugin specs)"
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: rake exit status: 1
rake stdout: == 20150817191541 CreateBookStoreBooks: migrating =============================
-- create_table(:book_store_books)
rake stderr: rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::UndefinedTable: ERROR: relation "authors" does not exist
: ALTER TABLE "book_store_books" ADD CONSTRAINT "fk_rails_52f80cb3c5"