This is a stats
lib that has no dependencies but needs to be initialized.
module.exports = function initializeStats(projectName, options) {
return {
mkdir -p exp &&\ | |
ls -1 | grep -v exp | xargs -I '@' cp -aRv @ exp/@ &&\ | |
find * -type f | grep -e '\.\(html\|scss\|css\|js\)$' | grep -ve '^exp' |\ | |
xargs -tn1 -I file bash -c 'expand -t 2 file > exp/file' &&\ | |
cp -avR exp/* . &&\ | |
rm -rf exp |
package transactions | |
import com.twitter.finagle.exp.mysql.{Client, OK, Result} | |
class Db(mysqlClient: Client) { | |
val insertOrder = "INSERT INTO orders (ref) VALUES(?)" | |
val insertOrderItem = "INSERT INTO order_items (order_id, item_id) VALUES(?, ?)" | |
def persistOrderWithItems[T](order: Order)(whenDone: (OK, Seq[Result]) => T): Future[T] = { |
Midje checkers (e.g. n-of
, has
, match
from matcher-combinators) cannot be resolved when using Cursive because they are declared using the defchecker
macro.
To make Cursive able to resolve these references as valid symbols, follow these steps:
defchecker.xml
file somewhere in your machine(require '[io.pedestal.service-tools.dev :as dev-tools]) | |
(def ^:private watcher (atom nil)) | |
(defn stop-watching [] | |
(let [stop @watcher] | |
(when (fn? stop) (stop) (reset! watcher nil)))) | |
(defn watch | |
([] (watch ["src/"])) |
function getOrElse(value, _) { | |
var args = Array.prototype.slice.call(arguments); | |
for (var i = 0; i < args.length; i++) { | |
var arg = args[i]; | |
if(typeof arg != "undefined" && arg != null && !isNaN(arg)) { | |
return arg; | |
} | |
} | |
return null; | |
} |
function appendRow(el, test, status, link) { | |
var testName = document.createElement("div"); | |
var statusCell = document.createElement("div"); | |
statusCell.innerText = status; | |
var order = (status == "Succeeded" ? 10 : 5); | |
testName.style = "flex-basis: 50%; flex-grow: 2; padding-bottom: 5px; margin-bottom: 5px; border-bottom: 1px dashed #666; order: " + order + ";"; | |
statusCell.style = "flex-grow: 1; text-align: right; padding-bottom: 5px; margin-bottom: 5px; border-bottom: 1px dashed #666; order: " + order + ";"; | |
if (link) { | |
var a = document.createElement("a"); | |
a.innerText = test; |
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: tomcat | |
# Defalt-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Description: Apache Tomcat 7 | |
### END INIT INFO | |
# base dir of tomcat installation # | |
CATALINA_HOME=/opt/tomcat/ |
For when you have incomplete JSON strings like:
{"Fault":
{"faultcode": "StartTransmissionFail",
"faultstring": {"content": "Internal Error"
Given an incomplete JSON-encoded string, attempts to complete it with the missing "
, }
and ]
characters necessary for it to be valid.