Skip to content

Instantly share code, notes, and snippets.

Michael Nitschinger daschl

Block or report user

Report or block daschl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:f0ebc85f9201cbbc67d0f4550c8e4a3d
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 80 01 00 03 08 02 00 73 00 00 00 3f 00 00 00 03 |.......s...?....|
|00000010| 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 |................|
|00000020| 66 6f 6f |foo |
+--------+-------------------------------------------------+----------------+
[cb-io-1-1] 2018-01-31 13:17:19 TRACE LoggingHandler:94 - [id: 0x886cc9fb, L:/10.142.171.1:49692 - R:/10.142.171.101:11210] WRITE: 52B
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
View gist:50bf4934a827f38c5cf38ad256ef5c26
[cb-io-1-1] 2018-01-31 07:38:27 TRACE LoggingHandler:94 - [id: 0xe0493676, L:/10.142.171.1:56858 - R:/10.142.171.101:11210] WRITE: 35B
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 80 01 00 03 08 02 00 73 00 00 00 0d 00 00 00 01 |.......s........|
|00000010| 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 |................|
|00000020| 66 6f 6f |foo |
+--------+-------------------------------------------------+----------------+
[cb-io-1-1] 2018-01-31 07:38:27 TRACE LoggingHandler:94 - [id: 0xe0493676, L:/10.142.171.1:56858 - R:/10.142.171.101:11210] WRITE: 4B
+-------------------------------------------------+
View main.rs
#[macro_use]
extern crate mozjs;
use mozjs::jsapi::CompartmentOptions;
use mozjs::jsapi::JS_NewGlobalObject;
use mozjs::jsapi::OnNewGlobalHookOption;
use mozjs::jsval::{Int32Value, UndefinedValue};
use mozjs::rust::{Runtime, SIMPLE_GLOBAL_CLASS};
use std::ptr;
View negotiation
[cb-io-1-1] 2018-01-29 15:08:25 DEBUG KeyValueFeatureHandler:126 - Requesting supported features: [TCPNODELAY, XATTR, SELECT_BUCKET, SNAPPY, XERROR]
[cb-io-1-1] 2018-01-29 15:08:25 TRACE LoggingHandler:94 - [id: 0x5b109a0c, L:/10.142.171.1:54661 - R:/10.142.171.101:11210] WRITE: 190B
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 80 1f 00 a6 00 00 00 00 00 00 00 b0 00 00 00 00 |................|
|00000010| 00 00 00 00 00 00 00 00 63 6f 75 63 68 62 61 73 |........couchbas|
|00000020| 65 2d 6a 61 76 61 2d 63 6c 69 65 6e 74 2f 32 2e |e-java-client/2.|
|00000030| 35 2e 35 2d 53 4e 41 50 53 48 4f 54 20 28 67 69 |5.5-SNAPSHOT (gi|
|00000040| 74 3a 20 32 2e 35 2e 34 2d 32 2d 67 66 31 33 66 |t: 2.5.4-2-gf13f|
View jaeger.java
import com.couchbase.client.java.Bucket;
import com.couchbase.client.java.Cluster;
import com.couchbase.client.java.CouchbaseCluster;
import com.couchbase.client.java.document.JsonDocument;
import com.couchbase.client.java.document.json.JsonObject;
import com.couchbase.client.java.env.CouchbaseEnvironment;
import com.couchbase.client.java.env.DefaultCouchbaseEnvironment;
import com.uber.jaeger.Configuration;
import io.opentracing.Tracer;
View show.hbs
import Ember from 'ember';
export default Ember.Component.extend({
didReceiveAttrs() {
this._super(...arguments);
const viz = this.get('viz');
Ember.Logger.info(viz.get('type')); // <--here data is undefined?
},
});
View fun.rs
pub fn from_config<S>(config: &BackendConfig) -> Result<impl Backend<S>, BackendError> where S: IntoBuf + 'static {
match config.name() {
"stdout" => Ok(StdoutBackend::stdout()),
"stderr" => Ok(StderrBackend::stderr()),
n => Err(BackendError::UnsupportedBackend(n.into())),
}
}
View main.rs
use futures::sink::Sink;
use bytes::{Buf, Bytes, IntoBuf};
// I want to have SinkItem = IntoBuf so it accepts anything that I can turn into a Buf
trait Backend: Sink<SinkItem = Bytes, SinkError = u8> {}
impl<W: Write> Backend for WriterBackend<W> {}
View lib.rs
let (complete_sender, complete_receiver) = oneshot::channel::<()>();
ctrlc::set_handler(move || {
complete_sender.send(());
}).expect("Error setting Ctrl-C handler");
error[E0507]: cannot move out of captured outer variable in an `Fn` closure
--> src/lib.rs:30:13
|
View legacy.java
@Override
public String hash(final NodeInfo info, final int repetition) {
String hostname = info.hostname().getHostAddress();
if (hostname.startsWith("/")) {
hostname = hostname.substring(1);
}
int port = info.services().get(ServiceType.BINARY);
return hostname + ":" + port + "-" + repetition;
}
You can’t perform that action at this time.