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
[ | |
{ | |
"name": "Amaranth (also Love-lies-bleeding)", | |
"care": { | |
"q1": "Plant in garden." | |
} | |
}, | |
{ | |
"name": "Asparagus", | |
"care": { |
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
{ | |
"attachments": [ | |
{ | |
"fallback": "users", | |
"callback_id": "b75e3599-b12b-412a-88ff-65d0cad93864", | |
"actions": [ | |
{ | |
"name": "foo", | |
"type": "select", | |
"text": "assign to", |
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
// When Cordova is not present Camera.getPicture() will throw an exception. | |
// Catch that and use your fixture image... | |
public takePicture(): void { | |
Camera.getPicture(options) | |
.then((data) => { | |
let base64Image: string = 'data:image/jpeg;base64,' + data; | |
this.save(base64Image); | |
}) | |
.catch(() => { | |
// openssl base64 -in small.png -out small.txt |
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
coverageReporter: { | |
reporters: [ | |
{type: 'text'}, | |
{ | |
type: 'lcov', | |
dir: process.env.CIRCLE_ARTIFACTS || '.', | |
subdir: 'coverage' | |
} | |
] | |
}, |
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
# app/controllers/slack/sessions_controller.rb | |
module Slack | |
class SessionsController < ApplicationController | |
before_action :ensure_no_error! | |
before_action :ensure_ok! | |
before_action :ensure_slack_token_valid! | |
before_action :ensure_account! | |
before_action :ensure_user! | |
expose(:slack_client) { Slack::Web::Client.new } |
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
def flatten_hash(hash) | |
hash.keys + hash.values.select do |value| | |
value.respond_to?(:keys) | |
end.map do |hash| | |
flatten_hash(hash) | |
end.flatten | |
end |
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
# Rails 3.2 generated timestamps with null: false but then this was reverted before 4.0 | |
# so if you migrated from 3.2 to 4.x, you'll always have this perpetual skew between your | |
# schema in source control and the schema in the database unless you correct it like | |
# this: | |
class SetTimestampsToNotNull < ActiveRecord::Migration | |
def change | |
tables = ActiveRecord::Base.connection.tables - ["schema_migrations"] | |
tables_with_timestamps = tables.select do |table| | |
ActiveRecord::Base.connection.columns(table).map(&:name).include?('created_at') | |
end |
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
# Activate the gem you are reporting the issue against. | |
gem 'activerecord', '4.0.3' | |
require 'active_record' | |
require 'minitest/autorun' | |
require 'logger' | |
require 'pry' | |
# Ensure backward compatibility with Minitest 4 | |
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test) |
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
git :init | |
git add: "." | |
git commit: "-a -m 'Initial commit'" | |
gem_group :development, :test do | |
gem 'rspec-rails' | |
end | |
gem_group :test do | |
gem 'shoulda-matchers' |
This file has been truncated, but you can view the full file.
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
/usr/bin/curl -f#LA Homebrew 0.9.5 (Ruby 1.8.7-358; Mac OS X 10.9) https://raw.github.com/cliffrowley/homebrew/patched_qt/Library/Formula/qt.rb -o /Library/Caches/Homebrew/Formula/qt.rb --silent | |
==> Cloning git://gitorious.org/qt/qt.git | |
git --git-dir /Library/Caches/Homebrew/qt--git/.git status -s | |
Updating /Library/Caches/Homebrew/qt--git | |
git config remote.origin.url git://gitorious.org/qt/qt.git | |
git config remote.origin.fetch +refs/heads/4.8:refs/remotes/origin/4.8 | |
git fetch origin | |
git checkout -f 4.8 | |
git reset --hard origin/4.8 | |
HEAD is now at 41621a2 QLocale: Update Portuguese and Greek locales data |
NewerOlder