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
// Inspired by a tweet from @trautonen 1/13/2016 | |
// Use Source.unfoldAsync to turn paginated database results into an akka-streams Source | |
// unfold is the inverse of fold | |
case class Page[T](pageNumber:Long, totalPages:Long, contents:List[T]) | |
case class Thing(id: Long, name: String = "foo") | |
val totalPages = 5 // | |
val pageSize = 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
#!/bin/bash | |
# Shamelessly stolen from https://gist.github.com/eduardocardoso/82a629882ddb02ab3677 | |
set -o errexit | |
echo "Removing exited docker containers..." | |
docker ps -a -f status=exited -q | xargs -r docker rm -v | |
echo "Removing untagged images..." | |
docker images --no-trunc | grep "<none>" | awk '{print $3}' | xargs -r docker rmi |
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
angular.module('extensions.restangular.auto-update', [ | |
'restangular' | |
]); | |
angular.module('extensions.restangular.auto-update') | |
.factory('RestangularAutoUpdate', function RestangularAutoUpdate(Restangular) { | |
// properties | |
var _routes = []; |
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
// from my https://github.com/joshlong/a-walking-tour-of-all-of-springdom project | |
import org.apache.commons.logging.*; | |
import org.springframework.batch.core.*; | |
import org.springframework.batch.core.configuration.annotation.*; | |
import org.springframework.batch.core.step.builder.StepBuilder; | |
import org.springframework.batch.item.*; | |
import org.springframework.batch.item.database.*; | |
import org.springframework.batch.item.file.FlatFileItemReader; | |
import org.springframework.batch.item.file.mapping.*; |
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 leoliang.springtest; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.springframework.beans.BeansException; | |
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; | |
import org.springframework.context.ApplicationContext; | |
import org.springframework.context.ApplicationContextAware; | |
import org.springframework.context.support.AbstractRefreshableApplicationContext; |
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
<script src="http://raphaeljs.com/raphael.js" type="text/javascript" charset="utf-8"></script> | |
<style type="text/css" media="screen"> | |
body { | |
background-color: black; | |
color: white; | |
font-family: helvetica; | |
} | |
#display { |