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
[Unit] | |
Description=MongoDB Database Service | |
Wants=network.target | |
After=network.target | |
[Service] | |
Type=forking | |
PIDFile=/var/run/mongodb/mongod.pid | |
ExecStart=/usr/local/bin/mongod --config /etc/mongod.conf | |
ExecReload=/bin/kill -HUP $MAINPID |
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
spawn = require('child_process').spawn | |
Bluebird = require 'bluebird' | |
mktemp = (pattern) -> | |
deferred = Bluebird.defer() | |
out = [] | |
s = spawn('mktemp', ['-t', pattern, '-d']) | |
s.stderr.setEncoding 'utf8' | |
s.stdout.setEncoding 'utf8' |
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
Show hidden characters
{ | |
"font_face": "monaco", | |
"ignored_packages": [ | |
"Vintage" | |
], | |
"rulers": [ | |
80 | |
], | |
"scroll_past_end": true, | |
"tab_size": 2, |
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
// assumes path of the form foo/bar/baz.png | |
// This function is not very generic | |
int mkdirp(const char *path) { | |
char *buf = (char*)alloca(strlen(path)); | |
char *last = strrchr(path, '/'); | |
int res = 0; | |
// Bail if there's no directories to make | |
if (last == NULL) { | |
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
#!/bin/bash | |
### NOTE ### You probably don't need this anymore! | |
# Just set RUST_BACKTRACE=1 | |
# Usage: rust-backtrace ./my-rust-prog args... | |
exec gdb -batch -n -x /dev/fd/3 --args "$@" 3<<ENDGDB | |
set height 0 | |
set breakpoint pending on |
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
#[macro_export] | |
macro_rules! impl_deserialize_fromstr { | |
($tyname:ident) => { | |
impl ::serde::de::Deserialize for $tyname { | |
/// Deserialize this value given this `Deserializer`. | |
fn deserialize<D>(deserializer: &mut D) -> ::std::result::Result<Self, D::Error> | |
where D: ::serde::de::Deserializer | |
{ | |
struct VariantVisitor<__D> { | |
_marker: ::std::marker::PhantomData<__D>, |
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
/// Improved println! macro that allows specifying stdout or stderr | |
/// | |
/// # Examples | |
/// | |
/// Printing to stdout works like normal | |
/// ```rust | |
/// zprintln!("Hello, zprintln!"); | |
/// ``` | |
/// | |
/// Printing to stderr works by passing a special argument |
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
web_push_test! { | |
web_push_response_created => { | |
response: web::Response::Created { uri: String::new() }, | |
remaining: 0, | |
successful: 1, | |
errored: 0, | |
sending_done: true, | |
}, | |
web_push_response_accepted => { | |
response: web::Response::Accepted { uri: String::new() }, |
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
// Copyright 2017 Google LLC. | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// https://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
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
diff --git a/route/route.go b/route/route.go | |
index d0f7ee8..0a92708 100644 | |
--- a/route/route.go | |
+++ b/route/route.go | |
@@ -396,6 +396,29 @@ func (r *Router) processEvent(ev *types.Event, reqID interface{}) error { | |
WithField("request_id", reqID). | |
WithString("api_host", ev.APIHost). | |
WithString("dataset", ev.Dataset) | |
+ var err error | |
+ |