Go to the official website and choose your OS.
Docker for Mac has a problem is the disk IO performance (see docker/for-mac#77).
There is a fix (https://github.com/IFSight/d4m-nfs) which makes Docker use NFS instead of OSXFS.
RSpec.configure do |config| | |
config.after(:each) do | |
if example.exception && example.metadata[:js] | |
meta = example.metadata | |
filename = File.basename(meta[:file_path]) | |
line_number = meta[:line_number] | |
screenshot_name = "screenshot-#{filename}-#{line_number}.png" | |
screenshot_path = "#{Rails.root.join("tmp")}/#{screenshot_name}" | |
page.save_screenshot(screenshot_path) |
// outside the scope of the jQuery plugin to | |
// keep track of all dropdowns | |
var $allDropdowns = $(); | |
// if instantlyCloseOthers is true, then it will instantly | |
// shut other nav items when a new one is hovered over | |
$.fn.dropdownHover = function(options) { | |
// the element we really care about | |
// is the dropdown-toggle's parent |
def filename | |
if original_filename | |
if model && model.read_attribute(mounted_as).present? | |
model.read_attribute(mounted_as) | |
else | |
"#{SecureRandom.hex}.#{File.extname(file.filename)}" | |
end | |
end | |
end |
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
#!/usr/bin/env ruby | |
require 'octokit' | |
project = ARGV[0] | |
if project.nil? | |
puts 'project is empty' | |
abort | |
end | |
client = Octokit::Client.new(:access_token => "") | |
# Create repo |
class ApplicationMailer < ActionMailer::Base | |
default from: Setting.first.email_from | |
add_template_helper(EmailHelper) | |
layout 'mailer' | |
end |
# config/initializers/active_admin.rb | |
ActiveAdmin.setup do |config| | |
config.namespace :admin do |admin| | |
admin.build_menu do |menu| | |
menu.add :label => "The Application", :url => "/", :priority => 0 | |
menu.add :label => "Sites" do |sites| | |
sites.add :label => "Google", :url => "http://google.com", :html_options => { :target => :blank } | |
sites.add :label => "Facebook", :url => "http://facebook.com" | |
sites.add :label => "Github", :url => "http://github.com" |
after_commit :set_average_color | |
def set_average_color | |
return unless self == section.images.first || section.bg_color.blank? | |
section.update_attribute :bg_color, get_average_color | |
end | |
def get_average_color | |
img = Magick::Image.read(file.path).first | |
pix = img.scale(1, 1) |
Go to the official website and choose your OS.
Docker for Mac has a problem is the disk IO performance (see docker/for-mac#77).
There is a fix (https://github.com/IFSight/d4m-nfs) which makes Docker use NFS instead of OSXFS.
-- show running queries (pre 9.2) | |
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |