Skip to content

Instantly share code, notes, and snippets.

View guizmaii's full-sized avatar
🏄‍♂️

Jules Ivanic guizmaii

🏄‍♂️
View GitHub Profile
@mslinn
mslinn / installScala
Last active August 29, 2015 14:08
Installs Scala on Mac, Ubuntu and other Debian derivatives
#!/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
@trevorrowe
trevorrowe / gist:7a36332bed24791a1196
Last active August 29, 2015 14:15
Uploading files to Amazon S3 using the AWS SDK for Ruby v2
# 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)
@olegykz
olegykz / gist:4079178
Created November 15, 2012 15:28
Skipping asset compilation with capistrano
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}
@andyhawthorne
andyhawthorne / unicorn_init.sh
Created September 4, 2012 22:35
start unicorn
#!/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
@agile-jordi
agile-jordi / EnumJson
Last active April 22, 2016 05:06
An object with functions the create Reads, Writes or Formats for Enums.
// 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] {
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
require 'dry-types'
class Carrier
attr_reader :name
def initialize(attributes)
@name = attributes.fetch(:name)
end
end
@guizmaii
guizmaii / empty_cognito_user_pool.sc
Last active September 29, 2017 15:02
Ammonite (http://ammonite.io/) script to remove all identities in a AWS Cognito Identity Pool
#!/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._

Hi, looking for scalac flags?

This gist has been upgraded to a blog post here.

@kevinwright
kevinwright / scaladays2014.md
Last active March 8, 2018 20:25
Scaladays 2014 slides

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