This file contains 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/content_for_inside_cache.rb | |
module AbstractController | |
class Base | |
attr_internal :cached_content_for | |
end | |
module Caching | |
# actionpack/lib/action_controller/caching/fragments.rb | |
module Fragments |
This file contains 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 'facets/hash/recurse' | |
# Usage: | |
# expect(actual).to match_hash(expected) | |
# | |
RSpec::Matchers.define :match_hash do |expected| | |
match do |actual| | |
# Sort hashes before comparing so that the diff only shows actual changes between keys and | |
# values. | |
actual = actual.recurse {|h| h.sort_by {|k,v| k.to_s }.to_h } |
This file contains 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
d3-force-labels.js |
This file contains 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
begin | |
require 'bundler/inline' | |
rescue LoadError => e | |
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
raise e | |
end | |
gemfile(true) do | |
source 'https://rubygems.org' | |
gem 'rails', '5.1.4' |
This file contains 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
ActionMailer::Base.class_eval do | |
class << self | |
protected | |
# Override the version from the actionmailer gem in order to not log attachments. | |
# | |
# Note: This depends on the patch from https://github.com/mikel/mail/pull/858, which adds | |
# parts.inspect_structure and fixes an issue with mail.without_attachments! | |
# |
This file contains 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
> zeus start | |
Starting Zeus server v0.15.3 | |
[ready] [crashed] [running] [connecting] [waiting] | |
boot | |
├── default_bundle | |
│ └── development_environment | |
│ └── prerake | |
├── default_bundle_with_test_env | |
│ └── test_environment | |
│ ├── cucumber_environment |
This file contains 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 "prawn" | |
Prawn::Document.generate("#{__FILE__}.pdf") do |pdf| | |
pdf.start_new_page margin: [100, 100, 100, 100] | |
pdf.stroke_axis | |
orig_bounds_width = pdf.bounds.width | |
pdf.formatted_text_box [ { :text => "width: #{pdf.bounds.width}" } ], :at => [0, 20] | |
pdf.indent(100) do | |
pdf.stroke_axis |
This file contains 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
canvas (stable) > time bundle exec rake canvas:compile_assets | |
--> Compiling static assets [css] | |
warning Webkit only supports pixels for the start and end stops for radial gradients. Got: 100% | |
warning Webkit only supports pixels for the start and end stops for radial gradients. Got: 100% | |
warning Webkit only supports pixels for the start and end stops for radial gradients. Got: 100% | |
--> creating styleguide | |
# writing file: app/views/info/styleguide.html.erb | |
--> Compiling static assets [jammit] | |
--> Compiled static assets [css/jammit] | |
--> Compiling static assets [javascript] |
This file contains 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
Following https://github.com/instructure/canvas-lms/wiki/Quick-Start I ran into some problems. Here's what I did to work around them. | |
I am installing on my development computer, running Ubuntu 13.10. | |
dpkg --get-selections | egrep -i "postgresql" | |
postgresql install | |
postgresql-9.1 install | |
postgresql-9.1-postgis deinstall | |
postgresql-client-9.1 install | |
postgresql-client-common install |
This file contains 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
# Change all datetime columns to have a precision of 0, to match the default precision of these | |
# columns in MySQL. | |
# | |
# This is useful if you migrate a database from MySQL to PostgreSQL and don't need the extra | |
# microsecond precision (precision: 6) that is the default in PostgreSQL | |
# (see http://www.postgresql.org/docs/9.2/static/datatype-datetime.html). | |
# | |
# Before: | |
# > some_record.created_at.strftime('%Y-%m-%d %H:%M:%S.%N') | |
# => "2013-07-25 11:49:33.270032000" |
NewerOlder