Skip to content

Instantly share code, notes, and snippets.

View alternegro's full-sized avatar

Altern Egro alternegro

View GitHub Profile
@nicocavallo
nicocavallo / Contenful.scala
Created September 8, 2017 21:37
Contentful Scala Library
package nicocavallo.contentful
import java.time.ZonedDateTime
import com.contentful.java.cda._
import com.typesafe.config.Config
import org.reactivestreams.{Subscriber, Subscription}
import scala.concurrent.{Future, Promise}
import scala.language.postfixOps

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

@urcadox
urcadox / Filters.scala
Created November 18, 2016 11:30
Play 2.5 HTTPS redirection on Clever Cloud
package controllers
import javax.inject._
import play.api._
import play.api.http.DefaultHttpFilters
import play.api.mvc._
import play.api.Environment
import scala.concurrent.{ExecutionContext, Future}
import akka.stream.Materializer
@sj26
sj26 / papertrail-to-s3.rb
Last active August 24, 2018 23:07 — forked from mujtaba3B/dl_papertrail_archives
Backup old papertrail archive to s3
require "active_support/all"
require "aws-sdk"
require "concurrent"
papertrail_token = "..."
s3 = Aws::S3::Client.new(region: "us-east-1")
s3_bucket = "..."
s3_prefix = "papertrail/logs/[account-id]"
@ian-kent
ian-kent / Authentication.scala
Created February 11, 2014 19:10
Akka based authentication and authorisation for Play Framework
package wrappers
import play.api._
import play.api.mvc._
import scala.concurrent._
import scala.concurrent.Future
import play.mvc.Http.Status
import ExecutionContext.Implicits.global
import play.libs.Akka
import akka.actor.{Actor, Props}
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active July 7, 2024 19:32
A badass list of frontend development resources I collected over time.
@samgranieri
samgranieri / 0-readme.md
Last active December 12, 2015 12:29 — forked from burke/0-readme.md

ruby-1.9.3-p385 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p385 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@frsyuki
frsyuki / article.md
Last active June 23, 2020 12:02
MessagePack for Ruby version 5

MessagePack for Ruby version 5

Today, I released the new version of MessagePack for Ruby!

Even faster

I rewrote all the code and achieved significant performance improvement, especially for serialization. I compared the new version to the old version (v4) using ruby-serializers benchmark, and the new version is faster for all data sets including Twitter, Image, Integers, Geo and 3D model.

@gerryster
gerryster / us_geo_chart_google
Created December 8, 2012 23:13
US State Map using the GeoChart from the Google Chart Tools
// GeoChart from https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart
// Try out by pasting code into: https://code.google.com/apis/ajax/playground/?type=visualization#geo_chart
function drawVisualization() {
var data = google.visualization.arrayToDataTable([
['State', 'Foo Factor'],
['US-IL', 200],
['US-IN', 300],
['US-IA', 20],
@mariussoutier
mariussoutier / Mail.scala
Created August 23, 2012 12:13
Sending mails fluently in Scala
package object mail {
implicit def stringToSeq(single: String): Seq[String] = Seq(single)
implicit def liftToOption[T](t: T): Option[T] = Some(t)
sealed abstract class MailType
case object Plain extends MailType
case object Rich extends MailType
case object MultiPart extends MailType