Skip to content

Instantly share code, notes, and snippets.

@amirkarimi
amirkarimi / 01.scala
Last active May 17, 2017 14:43
01-apply-settings-using-sbt-triggered-plugin
lazy val commonSettings = Seq(
organization := "com.example",
version := "0.1.0-SNAPSHOT"
)
lazy val core = (project in file("core"))
.settings(
commonSettings,
// other settings
)
@amirkarimi
amirkarimi / dist-play-app-initd
Last active August 29, 2015 14:26 — forked from RadoBuransky/dist-play-app-initd
Init.d shell script for Play framework distributed application. Provides start, stop, restart and status commands to control applications packaged using standard "play dist" packaging command.
#!/bin/bash
#
# =========================================================================
# Copyright 2014 Rado Buransky, Dominion Marine Media
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@amirkarimi
amirkarimi / CookieAuthenticator.scala
Last active October 3, 2016 15:29
CookieAuthenticator implemented on top of ReactiveMongo and Silhouette
package services
import scala.concurrent.Future
import scala.concurrent.ExecutionContext
import com.mohiva.play.silhouette.api.StorableAuthenticator
import com.mohiva.play.silhouette.impl.daos.AuthenticatorDAO
import com.mohiva.play.silhouette.impl.authenticators.CookieAuthenticator
import com.mohiva.play.silhouette.api.LoginInfo
import reactivemongo.bson._
import reactivemongo.api.collections.default.BSONCollection
@amirkarimi
amirkarimi / sms.wsdl
Created December 18, 2014 11:06
Sample WSDL for Scalaxb
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:s="http://www.w3.org/2001/XMLSchema" targetNamespace="http://SMSBox.gateway.webservice.sspk.co.ir/" xmlns:tns="http://SMSBox.gateway.webservice.sspk.co.ir/" name="SMSBoxImplementationService">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://SMSBox.gateway.webservice.sspk.co.ir/">
<s:element name="Send">
<s:complexType><s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="Auth" type="tns:Auth" />
<s:element minOccurs="1" maxOccurs="1" name="Recipients" type="tns:ArrayOfString" />
<s:element minOccurs="1" maxOccurs="1" name="Message" type="tns:ArrayOfString" />