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
package com.hanhuy.android.irc | |
import android.app.Activity | |
import android.app.ActionBar | |
import android.content.Intent | |
import android.content.Context | |
import android.content.BroadcastReceiver | |
import android.content.res.Configuration | |
import android.os.AsyncTask | |
import android.os.Build |
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 sbt._ | |
import sbt.Keys._ | |
import AndroidKeys._ | |
/* | |
* this represents a multi-project structure like: | |
* - root-project (wrapper/meta project) | |
* `- lite (android project) | |
* `- common (android library-project) |
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
# --- !Ups | |
CREATE TABLE users( | |
email VARCHAR(255) NOT NULL PRIMARY KEY, | |
name VARCHAR(255) | |
); | |
CREATE TABLE subjects( | |
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
title LONGTEXT NOT NULL, |
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 | |
#------------------------------------------------------------------------------ | |
# Name: sbtmkdirs | |
# Version: 1.5 | |
# Purpose: Create an SBT project directory structure with a few simple options. | |
# Author: Alvin Alexander, http://alvinalexander.com | |
# License: Creative Commons Attribution-ShareAlike 2.5 Generic | |
# http://creativecommons.org/licenses/by-sa/2.5/ | |
#------------------------------------------------------------------------------ |
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
package foo.bar | |
import spray.routing._ | |
import spray.http._ | |
import spray.http.StatusCodes.Forbidden | |
// See https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS | |
case class Origin(origin: String) extends HttpHeader { |
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
object RefactorPuzzle { | |
case class IntRdr[+A](read: Int => A) { | |
def map[B](f: A => B): IntRdr[B] = | |
IntRdr(f compose read) | |
def flatMap[B](f: A => IntRdr[B]): IntRdr[B] = | |
IntRdr(n => f(read(n)).read(n)) | |
} | |
object IntRdr { |
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
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo | |
sudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key | |
sudo yum -y install jenkins | |
sudo yum -y install java-1.7.0-openjdk.x86_64 | |
# Login as the jenkins user and specify shell explicity, | |
# since the default shell is /bin/false for most | |
# jenkins installations. | |
sudo su jenkins -s /bin/bash |
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
object Predicates { | |
type Pred[-T] = (T => Boolean) | |
implicitly[Seq[Int] >:> List[Int]] | |
implicitly[Pred[Seq[Int]] <:< Pred[List[Int]]] // predicate of seq is a subtype of predicate of list | |
val hasLength3: Pred[Seq[Int]] = _.size == 3 | |
hasLength3(Vector(1,2,3)) // we can pass any seq to hasLength3 | |
hasLength3(List(1,2,3)) |
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
package com.rackspace.dcx.dcorch.build | |
import sbt._ | |
trait Dependencies { | |
private object v { | |
val akka = "2.1.4" |
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 concurrent.{ExecutionContext, Future => SFuture, Promise} | |
import util.Try | |
import _root_.scalaz.\/ | |
import _root_.scalaz.concurrent.{Task => ZTask} | |
object Task { | |
def fromScala[A] |
OlderNewer