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/sh | |
SERVICE_NAME=ServiceName | |
PATH_TO_JAR=/srv/app/location/service-jar.jar | |
PID_PATH_NAME=/tmp/$SERVICE_NAME-pid | |
case $1 in | |
start) | |
echo "Starting $SERVICE_NAME ..." | |
if [ ! -f $PID_PATH_NAME ]; then |
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
library(ggplot2) | |
library(scales) | |
render_graph <- function(data) { | |
ggplot(data=data, aes(x=date, y=value)) + | |
geom_line(shape=1) + | |
scale_x_datetime(labels = date_format("%m/%d %H:%M")) | |
} | |
library(xts) |
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
# based on https://bocoup.com/weblog/padding-time-series-with-r | |
pad_data <- function(data, attr='date', value='value', by='hour') { | |
sorted.data <- data[order(data[[attr]]),] | |
info.data.length <- length(sorted.data[[attr]]) | |
info.date.min <- sorted.data[[attr]][1] | |
info.date.max <- sorted.data[[attr]][info.data.length] |
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 java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Properties; | |
import org.apache.avro.io.BinaryDecoder; | |
import org.apache.avro.io.BinaryEncoder; | |
import org.apache.avro.io.DecoderFactory; |
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 | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) |
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
<div class="row row-no-padding wrapper"> | |
<div class="sidebar-left-wrapper"> | |
Left | |
</div> | |
<div class="page-content-wrapper"> | |
Content | |
</div> | |
<div class="sidebar-right-wrapper"> | |
Right | |
</div> |
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
var key = 'name'; | |
return objs.sort(function (a, b) { | |
if (a[key] > b[key]) { | |
return asc ? 1 : -1; | |
} else if (a[key] < b[key]) { | |
return asc ? -1 : 1; | |
} else { | |
return 0; | |
} |
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
set vertical-split = false | |
set git-colors = yes | |
set show-changes = yes | |
set commit-order = topo | |
set refresh-mode = auto | |
set main-view = \ | |
date:default \ | |
author:full \ | |
id:yes,color \ |
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
. |
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
var escodegen = require('escodegen'); | |
var parse = require("esprima").parse; | |
var fs = require("fs"); | |
var src = fs.readFileSync( | |
"test.js", | |
"utf-8" | |
); | |
var ast = parse(src); |