simple example of process substitution in shell (bash)
> echo <(true)
/dev/fd/11
now with Ruby (IRB) - note: Ruby is shelling out to /bin/sh
not /bin/bash
A goal of the engineering team is to improve code quality and consistancy. One of the simplest ways to head in that direction is to start (or further) the use of RuboCop. If you're not farmiliar, RuboCop is a static Ruby code analyzer that use a common Ruby Style Guide as it's basis for enforcing standards. Once installed (it's just a gem) the RuboCop binary can be used as part of our development workflow to help enforce standards and consistancy on a change by change basis (with the help of Guard for example).
Realizing that some projects currently have a version of RuboCop setup and some do not at all we would like to take a gradual approach to introducing RuboCop. The idea would be to get RuboCop installed on an existing code base and then disable all of the cops that are not passing at the outset. From there we would spend a little time each week (or as you're naturally editing an existing piece of code) bringing things
#!/bin/bash | |
PASSWORD=$1 | |
if [[ $1 = '' ]]; then | |
echo Please provide your spotinst password | |
exit 1 | |
fi | |
echo $PASSWORD |
class ApplicationController < ActionController::Base | |
# Prevent CSRF attacks by raising an exception. | |
# For APIs, you may want to use :null_session instead. | |
protect_from_forgery with: :exception | |
def current_user=(user) | |
session[:user_id] = user.uid | |
end | |
def current_user |
I hereby claim:
To claim this, I am signing this object:
nib
is a convenience wrapper for docker-compose
nib
is pluggable via additional gems. The plugin system is loosely based on that of minitest extensions. There are three requirements for a nib
plugin:
Regular automated builds and testing of a code base. We are using CircleCI to facilitate CI (and sometimes CD, see Container Runtime).
version: '2.3' | |
services: | |
web: | |
image: kong:latest | |
links: | |
- db | |
environment: | |
- "KONG_DATABASE=postgres" | |
- "KONG_PG_HOST=db" | |
- "KONG_PROXY_ACCESS_LOG=/dev/stdout" |
Founded ~10 years ago with support for Rails
Purchased by SalesForce in 2010
Heroku Platform as a Service (PaaS) vs AWS Infrastructure as a Service (IaaS)
Fully managed app deployment and hosting
#! /usr/bin/env bash | |
STATUS="$(/usr/local/bin/mpc status)" | |
if [ $(echo "$STATUS" | wc -l | tr -d ' ') == "1" ]; then | |
status="[empty]" | |
else | |
artist=$(echo "$STATUS" | awk -F" - " 'NR==1{print $1}') | |
song=$(echo "$STATUS" | awk -F" - " 'NR==1{print $2}') | |
status=$(echo "$STATUS" | awk 'NR==2{print $1}') |