This gist has been upgraded to a blog post here.
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 | |
# Installs specified Scala version, and enables colorized REPL | |
SCALA_VERSION=2.11.4 | |
if [ "$1" ]; then SCALA_VERSION=$1; fi | |
set -e | |
case "$OSTYPE" in |
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
# You can pass client options directly to the Resource constructor, | |
# no need to construct a client yourself | |
s3 = Aws::S3::Resource.new( | |
credentials: Aws::Credentials.new('akid', 'secret'), | |
region: 'eu-west-1' | |
) | |
s3.bucket('backup').object('dir/subdir/filename.txt').upload_file(local_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
namespace :deploy do | |
namespace :assets do | |
task :precompile, :roles => :web, :except => { :no_release => true } do | |
begin | |
from = source.next_revision(current_revision) # <-- Fail here at first-time deploy | |
rescue | |
err_no = true | |
end | |
if err_no || capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0 | |
run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile} |
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/sh | |
set -e | |
# Feel free to change any of the following variables for your app: | |
TIMEOUT=${TIMEOUT-60} | |
APP_ROOT=/home/you/apps/app_name/current | |
PID=$APP_ROOT/tmp/pids/unicorn.pid | |
CMD="cd $APP_ROOT; bundle exec unicorn -D -c $APP_ROOT/config/unicorn.rb -E production" | |
AS_USER=andy | |
set -u |
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
// With an enumeration like... | |
// object Color extends Enumeration{...} | |
// Create a format (or reads or writes) like this: | |
// val fmt = EnumJson.enumFormat(Color); | |
// The implementation | |
object EnumJson { | |
def enumReads[E <: Enumeration](enum: E): Reads[E#Value] = new Reads[E#Value] { |
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 cats.instances.future._ | |
import cats.instances.option._ | |
import cats.syntax.traverse._ | |
import cats.syntax.cartesian._ | |
import scala.concurrent.Future | |
trait Guizmaii { | |
import scala.concurrent.ExecutionContext.Implicits.global |
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
require 'dry-types' | |
class Carrier | |
attr_reader :name | |
def initialize(attributes) | |
@name = attributes.fetch(:name) | |
end | |
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
#!/usr/local/bin/amm | |
import sys.process._ | |
import collection.mutable | |
import ammonite.ops._ | |
import ammonite.ops.ImplicitWd._ | |
import $ivy.`com.amazonaws:aws-java-sdk:1.11.204` | |
import com.amazonaws.services.cognitoidp._ |
As compiled by Kevin Wright a.k.a @thecoda
(executive producer of the movie, and I didn't even know it... clever huh?)
please, please, please - If you know of any slides/code/whatever not on here, then ping me on twitter or comment this Gist!
This gist will be updated as and when I find new information. So it's probably best not to fork it, or you'll miss the updates!
Monday June 16th
OlderNewer