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
module Concerns | |
module AasmStateEvent | |
extend ActiveSupport::Concern | |
included do | |
attr_accessor :state_event | |
end | |
# It behaves just like `save!`, but when `state_event` was set through | |
# `assign_attributes` before, `save!` uses the given state with a `!` 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
#!/usr/bin/env bash | |
mkdir /var/app/ondeck/vendor /var/app/ondeck/public /var/app/support/bundle /var/app/support/assets /var/app/support/cache | |
ln -s /var/app/support/bundle /var/app/ondeck/vendor | |
ln -s /var/app/support/assets /var/app/ondeck/public | |
ln -s /var/app/support/cache /var/app/ondeck/vendor | |
sed -i 's/"rake/"bundle exec rake/' /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh |
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
module LiquidPresenters | |
class Plan < SimpleDelegator | |
def to_liquid | |
@to_liquid ||= HashWithIndifferentAccess.new({ | |
id: self.id, | |
name: self.name, | |
description: self.description, | |
status: self.status, | |
class_id: self.plan_class_id | |
}) |
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
# Sidekiq interaction and startup script | |
commands: | |
create_post_dir: | |
command: "mkdir -p /opt/elasticbeanstalk/hooks/appdeploy/post" | |
ignoreErrors: true | |
files: | |
"/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq.sh": | |
mode: "000755" | |
owner: root | |
group: root |
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
# coding: utf-8 | |
require 'rubygems' | |
require 'thinreports' | |
report = ThinReports::Report.new :layout => 'advanced_list' | |
report.layout.config.list(:advanced_list) do | |
# Define the variables used in list. | |
use_stores :row_count => 0, |
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/env ruby | |
require "codeclimate-test-reporter" | |
branch = ENV['CIRCLE_BRANCH'] | |
node_index = ENV['CIRCLE_NODE_INDEX'].to_i | |
node_total = ENV['CIRCLE_NODE_TOTAL'].to_i | |
artifacts_dir = ENV['CIRCLE_ARTIFACTS'] | |
coverage_dir = File.join("..", "..", "..", ENV['CIRCLE_ARTIFACTS'], "coverage") | |
filename = '.resultset.json' |
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/env bash | |
# | |
# Rails console script that can be run on AWS Elastic Beanstalk. | |
# | |
# Run this script from the app dir (/var/app/current) as root (sudo script/aws-console) | |
# | |
set -xe | |
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir) |
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
packages: | |
yum: | |
git: [] | |
htop: [] |
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 axios from 'axios' | |
import jsifyKeysDeep from 'jsify-case-keys-deep' // Like `camelcase-keys-deep` but also transforms suffix '?' with prefix `is` | |
import decamelizeKeysDeep from 'decamelize-keys-deep' | |
import Qs from 'qs' | |
export default (baseURL) => { | |
const axiosClient = axios.create({ | |
baseURL, | |
responseType: 'json', | |
}) |
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
#!/bin/bash | |
cat $(find app/assets/stylesheets/ -type f) | | |
grep -Eo '\.[a-z]+[a-z0-9_-]*' | sort | uniq | sed s/.// | | |
while read CSS; do | |
if ! grep -Erqi "([^(remove|has)]?class[(:|=|[:space:]*=>[:space:]*)]*[[:space:]\W]*[(\"|')]*[-a-z0-9[:space:]]*$CSS|\\.$CSS\b)" app/views/ vendor/assets/ app/assets/javascripts/; then | |
echo $CSS >> unused.scss; | |
fi | |
done |
OlderNewer