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.test.parsersandbox; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
import java.util.stream.Stream; | |
import org.apache.calcite.runtime.CalciteContextException; | |
import org.apache.calcite.sql.SqlCall; | |
import org.apache.calcite.sql.SqlIdentifier; | |
import org.apache.calcite.sql.SqlNode; |
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
//For a given dollar amount (as an integer 100 == $1) compute all combinations of coins | |
//that can make even change | |
let changePermutations = (v, coinDenominations) => { | |
let subCombinations = (accum, sumAccum, total, coins) => { | |
//Base case: there's no coins left to try or remaining coins would take us beyond zero | |
if(coins.length == 0 || total < 0) return accum; | |
//This coin being attempted reduces to zero, making even change | |
if(total == 0) return accum.concat([sumAccum]); |
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 Main extends App { | |
val system = ActorSystem("my-system") | |
val ec = system.dispatcher | |
//we don't use the actor system ec here, but let's ignore that | |
val userService = new UserServiceImpl(ec) | |
val foobarService = new FoobarServiceImpl(userService) | |
val restActor = system.actorOf(Props(new RestActor(userService, foobarService)) "actor") | |
} | |
class RestActor(val userService:UserService, val foobarServiceFoobarService) extends Registry with UserRoutes { |
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
trait Registry { | |
val ec:ExecutionContext | |
val userService = new UserServiceImpl(ec) | |
val fooBarService = new FoobarServiceImpl(userService) | |
} | |
class RestActor extends Registry with UserRoutes { | |
def receive = { | |
userRoutes ~ | |
otherRoutesFromOtherMixins |
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
'use strict'; | |
var React = require('react'); | |
var ProgressTracker = require('./js/ProgressTracker.jsx') | |
var FormFlow = React.createClass({ | |
getInitialState: function(){ | |
return { | |
statusClass: "pure-u-1-1 status-bar", | |
controlClass: "pure-u-1-1 control-bar", | |
nextBtnClass: "button-success pure-button next", |
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
watch: | |
watchmedo shell-command --recursive --command='rsync -avt --delete --exclude '*.pyc' --exclude '.git' . user@remotehost:folder/path' |
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.gn.gncore.models | |
import java.util.UUID | |
import org.joda.time.DateTime | |
import org.joda.time.LocalTime | |
/** Core place model throughout service | |
*/ | |
case class Place( | |
id:String, |
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.spotify.wakka | |
import akka.actor.{Actor, ActorSystem, Props, ActorLogging, ActorRef} | |
import akka.routing._ | |
import akka.actor.ActorDSL._ | |
import akka.io.IO | |
import spray.can.Http | |
import spray.routing._ | |
import spray.httpx.Json4sJacksonSupport | |
import org.json4s._ |
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
upstream backend { | |
server 127.0.0.1:8888; | |
} | |
server { | |
listen 80 default; | |
access_log /var/log/nginx/backend_access.log; | |
error_log /var/log/nginx/backend_error.log; | |
location / { |
NewerOlder