:= binds single value
+= appends single value
++= appends seq of values
<<= binds single value
<+= appends single value
class A | |
class A2 extends A | |
class B | |
trait M[X] | |
// | |
// Upper Type Bound | |
// | |
def upperTypeBound[AA <: A](x: AA): A = x |
var MyOption, Option; | |
Array.prototype.filter = function(f) { | |
var x, _i, _len, _results; | |
_results = []; | |
for (_i = 0, _len = this.length; _i < _len; _i++) { | |
x = this[_i]; | |
if (f(x)) { | |
_results.push(x); | |
} |
All you need to do is, | |
In your SBT Dependencies add, | |
"de.neuland" % "jade4j" % "0.3.11" from "https://raw.github.com/neuland/jade4j/master/releases/de/neuland/jade4j/0.3.11/jade4j-0.3.11.jar", | |
"com.googlecode.concurrentlinkedhashmap" % "concurrentlinkedhashmap-lru" % "1.3.1", | |
"org.apache.commons" % "commons-jexl" % "2.1.1" | |
You need apache libs as Jade4J uses them internally, |
package spray.json | |
import scala.language.experimental.macros | |
trait AutoProductFormat extends DefaultJsonProtocol { | |
implicit def jsonFormat[T <: Product]: RootJsonFormat[T] = macro AutoProductFormatMacro.autoProductFormatMacro[T] | |
} | |
object AutoProductFormat extends AutoProductFormat |
#!/bin/bash | |
### USAGE | |
### | |
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7 | |
### ./ElasticSearch.sh will fail because no version was specified (exit code 1) | |
### | |
### CLI options Contributed by @janpieper | |
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch |
CREATE OR REPLACE FUNCTION notify_trigger() RETURNS trigger AS $$ | |
DECLARE | |
channel_name varchar DEFAULT (TG_TABLE_NAME || '_changes'); | |
BEGIN | |
IF TG_OP = 'INSERT' THEN | |
PERFORM pg_notify(channel_name, '{"id": "' || NEW.id || '"}'); | |
RETURN NEW; | |
END IF; | |
IF TG_OP = 'DELETE' THEN | |
PERFORM pg_notify(channel_name, '{"id": "' || OLD.id || '"}'); |
var script = document.createElement("script"); | |
script.setAttribute("src", "//code.jquery.com/jquery-latest.min.js"); | |
script.addEventListener('load', function() { | |
var script = document.createElement("script"); | |
document.body.appendChild(script); | |
}, false); | |
document.body.appendChild(script); |
#!/usr/bin/env node | |
const assert = require('assert'); | |
const { delay } = require('bluebird'); | |
const BigNumber = require('bignumber.js'); | |
const kraken = require('./kraken'); | |
const { | |
fetchMyOpenOrders, | |
fetchOrderBook, | |
placeOrder, |
# Feel free to change this path of course (and keys_zone value as well, but also change the usage of it below). | |
proxy_cache_path /var/www/cache/resized levels=1:2 keys_zone=resizedimages:10m max_size=1G; | |
# Gzip was on in another conf file of mine...You may need to uncomment the next line. | |
#gzip on; | |
gzip_disable msie6; | |
gzip_static on; | |
gzip_comp_level 4; | |
gzip_proxied any; | |
# Again, be careful that you aren't overwriting some other setting from another config's http {} section. |