Skip to content

Instantly share code, notes, and snippets.

View NicolaeNMV's full-sized avatar

Nicu Namolovan NicolaeNMV

View GitHub Profile
@iref
iref / evolutions-di.scala
Last active September 4, 2015 11:19
Running evolutions with Compile-time DI
trait ApplicationComponent extends BuiltInComponents with SlickComponents
with I18nComponents with EvolutionsComponents with SlickEvolutionsComponents {
lazy val dbConfigProvider: DatabaseConfigProvider = new DatabaseConfigProvider {
override def get[P <: BasicProfile]: DatabaseConfig[P] = api.dbConfig(DbName("default"))
}
lazy val router: Router = wire[Routes] withPrefix "/"
lazy val assets: Assets = wire[Assets]
package utils
import scala.util.{ Try, Success, Failure }
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
import akka.actor._
// This actor will perform asynchronous side effects sequentially.
// It ensures two effects are not performed at the same time, without blocking.
# Install dependencies
#
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \
mkdir -p ~/sources/ && \
# Compile against OpenSSL to enable NPN
@trey
trey / dropbox_git.md
Created May 18, 2012 03:12
Using Dropbox to Share Git Repositories

Using Dropbox to Share Git Repositories

First, create a Git subfolder inside your Dropbox folder. Then you can share the individual projects inside that folder with whomever you want (or just use it for instant offsite backups).

From inside a Git project:

git clone --bare . ~/Dropbox/Git/gitproject.git
git remote add dropbox ~/Dropbox/Git/gitproject.git

When you're ready to push:

@cdown
cdown / gist:1163649
Last active April 9, 2024 01:10
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in