Skip to content

Instantly share code, notes, and snippets.

View parndt's full-sized avatar
🇺🇦

Philip Arndt parndt

🇺🇦
View GitHub Profile
DEPRECATION WARNING: The following options in your Gallery.has_many :gallery_images declaration are deprecated: :order. Please use a scope block instead. For example, the following:
has_many :spam_comments, conditions: { spam: true }, class_name: 'Comment'
should be rewritten as the following:
has_many :spam_comments, -> { where spam: true }, class_name: 'Comment'
$ brew install mongodb
==> Downloading http://downloads.mongodb.org/src/mongodb-src-r2.6.3.tar.gz
Already downloaded: /Library/Caches/Homebrew/mongodb-2.6.3.tar.gz
==> /usr/local/opt/scons/bin/scons install --prefix=/usr/local/Cellar/mongodb/2.6.3 -j8 --cc=/usr/bin/clang --cxx=/usr/bin/clang++ --osx-version-
/usr/bin/clang++ -o build/darwin/64/cc__usr_bin_clang/cxx__usr_bin_clang++/osx-version-min_10.9/third_party/s2/s2edgeindex.o -c -Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -pipe -Werror -O3 -m64 -Wno-unused-function -Wno-unused-private-field -Wno-deprecated-declarations -Wno-tautological-constant-out-of-range-compare -Wno-unused-const-variable -mmacosx-version-min=10.9 -Isrc/third_party/s2 -DDEBUG_MODE=false -Wno-mismatched-tags -DBOOST_ALL_NO_LIB -D_SCONS -DMONGO_EXPOSE_MACROS -DSUPPORT_UTF8 -DMONGO_OPTIMIZED_BUILD -D_FILE_OFFSET_BITS=64 -DMONGO_HAVE___THREAD -DMONGO_HAVE_HEADER_UNISTD_H -DMONGO_HAVE_EXECINFO_BA
@parndt
parndt / upgrade.diff
Last active August 29, 2015 14:16
Rails 4.1 -> 4.2 upgrade (important stuff) diff
diff --git a/Gemfile b/Gemfile
index 71f3511..6746bc9 100644
--- a/Gemfile
+++ b/Gemfile
@@ -3,7 +3,7 @@ source "https://rubygems.org"
ruby "2.2.0"
# Bundle edge Rails instead: gem "rails", github: "rails/rails"
-gem "rails", "4.1.9"
+gem "rails", "~> 4.2.0"
# Custom types are scoped to a particular site instance,
# so their class names are suffixed with the site ID.
# This also helps Content#const_missing figure out when we're
# trying to load a custom type, because it gets numbers at the
# end of the class name.
# Note: I've put some validation logic in CustomType to ensure
# that the name in the database is a valid Ruby constant name.
# new_custom_type = Content::CustomType.create(:site_id => 1, :name => "My custom type")
# Content::MyCustomType1 #=> Content::MyCustomType1(...)
Filesystem Size Used Avail Capacity Mounted on
/dev/disk0s2 59Gi 53Gi 6.0Gi 90% /
devfs 110Ki 110Ki 0Bi 100% /dev
map -hosts 0Bi 0Bi 0Bi 100% /net
map auto_home 0Bi 0Bi 0Bi 100% /home
/dev/disk1s2 97Gi 88Gi 9.2Gi 91% /Volumes/Macintosh HD
/dev/disk1s3 135Gi 130Gi 4.8Gi 97% /Volumes/Backups
git remote add -f avit git://github.com/avit/refinerycms.git
git checkout -b avit/presenters
git cherry-pick e28b5e8ef9393ee6df441828ad72eb2014d57b5d
# make changes and then
git commit -c e28b5e8
git checkout master
git merge avit/presenters
# /shared/_menu.html.erb
<% cache(:action_suffix => "site_menu") do %>
<ul id='<%= dom_id ||= "menu" %>' class='menu clearfix'>
<%= render :partial => "/shared/menu_branch", :collection => @menu_pages, :locals => {
:hide_children => RefinerySetting.find_or_set(:menu_hide_children, false)
} -%>
</ul>
<% end %>
# /shared/_menu_branch.html.erb
demolicious/
|-- LICENSE
|-- README
|-- page_layouts
| |-- config.yml
| |-- homepage.erb.html
| `-- locale.yml
|-- images
|-- stylesheets
`-- views
# place in config/environments/development.rb
config.after_initialize do
::ActiveSupport::Dependencies.load_once_paths = ::ActiveSupport::Dependencies.load_once_paths.select do |path|
(path =~ /app/).nil?
end
end
# bulk upload images to refinery
# open script/console on refinery site
# > script/console
# define some functions we need
include ActionController::TestProcess
def use_temp_file(fixture_filename)
temp_path = File.join('/tmp', File.basename(fixture_filename))
FileUtils.mkdir_p File.join('/', 'tmp')
FileUtils.cp File.join('/', fixture_filename), File.join('/', temp_path)