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
class BenchmarkEvaluator | |
def initialize(count) | |
@count = count | |
end | |
def execute | |
results = {} | |
Rails.logger.info '===== Enqueuing jobs' | |
benchmark = "Enqueuing #{@count} ActiveJob jobs" | |
results[benchmark] = Benchmark.measure do |
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
# lib/tasks/db.rake | |
namespace :db do | |
desc "Dumps the database to db/APP_NAME.dump" | |
task :dump => :environment do | |
cmd = nil | |
with_config do |app, host, db, user| | |
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump" | |
end | |
puts cmd |
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
class BenchmarkEvaluator | |
def initialize(count) | |
@count = count | |
end | |
def execute | |
results = {} | |
Rails.logger.info '===== Enqueuing jobs' | |
benchmark = "Enqueuing #{@count} ActiveJob jobs" | |
results[benchmark] = Benchmark.measure do |
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
image: user/docker_image_name | |
pipelines: | |
branches: | |
'*': | |
- step: | |
script: | |
- export DATABASE_URL=postgresql://pg_user:pg_user_password@localhost/pipelines | |
- bundle exec rails db:schema:load RAILS_ENV=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
Widget build(BuildContext context) { | |
return FutureBuilder( | |
future: fetchMovies(), | |
builder: (context, AsyncSnapshot snapshot) { | |
if (!snapshot.hasData) { | |
return Center( | |
child: Image.asset('assets/images/loading.gif'), | |
); | |
} else { | |
return HorizontalCards(snapshot.data.movies); |
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
Widget build(BuildContext context) { | |
return FutureBuilder( | |
future: fetchMovies(), | |
builder: (context, AsyncSnapshot snapshot) { | |
if (!snapshot.hasData) { | |
return Center( | |
child: Image.asset('assets/images/loading.gif'), | |
); | |
} else { | |
return HorizontalCards(snapshot.data.movies); |
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
body: SingleChildScrollView( | |
child: Column( | |
children: <Widget>[ | |
SizedBox(height: 10.0), | |
Text( | |
movieName, | |
style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold), | |
), | |
SizedBox(height: 10.0), | |
Text( |
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
# 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: |
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
import 'package:flutter/material.dart'; | |
import 'package:flutter_dotenv/flutter_dotenv.dart'; | |
import './pages/home_page.dart'; | |
import './pages/search_movies.dart'; | |
Future main() async { | |
await DotEnv().load('.env'); | |
runApp(MyApp()); | |
} |
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
FROM ruby:2.3.1 | |
# Install dependencies | |
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs | |
# Set an environment variable where the Rails app is installed to inside of Docker image: | |
ENV RAILS_ROOT /var/www/app_name | |
RUN mkdir -p $RAILS_ROOT | |
# Set working directory, where the commands will be ran: |
NewerOlder