This file contains hidden or 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
trait Flying | |
trait Landed | |
case class Plane[Status]() | |
def land(p:Plane[Flying])=Plane[Landed]() | |
def takeOff(p:Plane[Landed])= Plane[Flying]() | |
val plane = new Plane[Landed]() |
This file contains hidden or 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
var rqRaw = (function(method){ | |
var client = Envjs.ahcClient | |
switch(method) { | |
case "POST": return client.preparePost( xhr.url ); break; | |
case "GET": return client.prepareGet( xhr.url ); break; | |
case "PUT": return client.preparePut( xhr.url ); break; | |
case "DELETE": return client.prepareDelete( xhr.url ); break; | |
case "HEAD": return client.prepareHead( xhr.url ); break; | |
case "OPTIONS": return client.prepareOptions( xhr.url ); break; | |
default: throw "Method "+xhr.method.toUpperCase+" Not Implemented in Envjs.remoteXHR. Naughty coder was lazy!" |
This file contains hidden or 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 aptitude -y install nginx | |
cd /etc/nginx/sites-available | |
sudo rm default | |
sudo cat > jenkins | |
upstream app_server { | |
server 127.0.0.1:8080 fail_timeout=0; | |
} | |
server { | |
listen 80; |
This file contains hidden or 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
/* | |
You can now create a spinner using any of the variants below: | |
$("#el").spin(); // Produces default Spinner using the text color of #el. | |
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el. | |
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color). | |
$("#el").spin({ ... }); // Produces a Spinner using your custom settings. | |
$("#el").spin(false); // Kills the spinner. |
This file contains hidden or 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
set -g default-terminal "screen-256color" | |
set -g status-utf8 on | |
bind M source-file ~/.tmux/mac.session | |
bind L source-file ~/.tmux/linux.session | |
# set -g terminal-overrides 'xterm*:smcup@:rmcup@' | |
# THEME | |
set -g status-bg black |
This file contains hidden or 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
// Mersenne Twister 19937 | |
// Based on code from: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html | |
// Note: This implementation is not thread-safe! | |
final class MersenneTwister (seed: Int = 5489) { | |
private val N = 624 | |
private val M = 397 | |
private val MatrixA = 0x9908b0dfL | |
private val UpperMask = 0x80000000L |
This file contains hidden or 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
upstream artifacts { | |
server 127.0.0.1:8081 fail_timeout=0; | |
} | |
server { | |
listen 80; | |
root /var/www; | |
server_name artifacts.inconcert artifacts; |
This file contains hidden or 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
$ tree cookbooks/cassandra/ | |
cookbooks/cassandra/ | |
├── attributes | |
├── definitions | |
├── files | |
│ └── default | |
├── libraries | |
├── metadata.rb | |
├── providers | |
├── README.md |
This file contains hidden or 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 com.googlecode.objectify.annotation | |
import scala.annotation.target.field | |
object Annotations { | |
type AlsoLoad = annotation.AlsoLoad @field | |
type Embed = annotation.Embed @field | |
type Id = annotation.Id @field | |
type Ignore = annotation.Ignore @field | |
type IgnoreLoad = annotation.IgnoreLoad @field |
This file contains hidden or 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 language.experimental.macros | |
import scala.reflect.makro.Context | |
object MacroSample { | |
def compiledTime(): String = macro compiledTime_impl | |
def compiledTime_impl(c: Context)(): c.Expr[String] = { | |
import c.mirror._ | |
import c.reify |