Skip to content

Instantly share code, notes, and snippets.

View bleathem's full-sized avatar

Brian Leathem bleathem

View GitHub Profile
> db.scans.find({timestamp: {$gt: date}, beaconId: '229', retransmit:false}, {_id: 0, created:0, __v: 0}).sort({timestamp:1})
{ "beaconId" : "229", "locationCode" : "Room202", "type" : "check-out", "timestamp" : ISODate("2015-05-21T19:40:32.039Z"), "retransmit" : false }
{ "beaconId" : "229", "locationCode" : "Room202", "type" : "check-in", "timestamp" : ISODate("2015-05-21T19:40:37.025Z"), "retransmit" : false }
{ "beaconId" : "229", "locationCode" : "Room202", "type" : "check-out", "timestamp" : ISODate("2015-05-21T19:42:42.025Z"), "retransmit" : false }
{ "beaconId" : "229", "locationCode" : "Room202", "type" : "check-in", "timestamp" : ISODate("2015-05-21T19:42:47.023Z"), "retransmit" : false }
{ "beaconId" : "229", "locationCode" : "Room202", "type" : "check-out", "timestamp" : ISODate("2015-05-21T19:43:12.035Z"), "retransmit" : false }
{ "beaconId" : "229", "locationCode" : "Room202", "type" : "check-in", "timestamp" : ISODate("2015-05-21T19:43:17.023Z"), "retransmit" : false }
{ "beaconId" : "229", "lo
void GitDiff::BlobToBufferWorker::Execute() {
int result = git_diff_blob_to_buffer(
baton->old_blob,baton->old_as_path,baton->buffer,baton->buffer_len,baton->buffer_as_path,baton->options,baton->file_cb,baton->hunk_cb,baton->line_cb,baton->payload );
}
void GitDiff::BlobToBufferWorker::HandleOKCallback() {
TryCatch try_catch;
if (baton->error_code == GIT_OK) {
@bleathem
bleathem / gist:1b9fb04cc2d3b18bb05b
Created March 25, 2015 19:15
OpenShift v3 service definition
{
"apiVersion": "v1beta1",
"items": [
{
"apiVersion": "v1beta1",
"containerPort": 8000,
"id": "frontend",
"kind": "Service",
"port": 8000,
"PublicIPs": ["192.168.1.100"], // Not sure about this line
@bleathem
bleathem / gist:50b4dd2fd4377503eaad
Last active August 22, 2018 20:54
Creating an Rx.js Observable from a STOMP over Websocket source (with error handling)
// see: https://github.com/jmesnil/stomp-websocket
var client = Stomp.client('ws://...');
client.debug = undefined;
var live = Rx.Observable.create(function (observer) {
console.log('Connecting...')
client.connect(username, password, function(frame) {
console.log(frame.toString());
observer.onNext(frame);
-compile:
[javac] Compiling 5 source files to /home/bleathem/workspace/cordova/hello/platforms/android/ant-build/classes
[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[javac] /home/bleathem/workspace/cordova/hello/platforms/android/src/org/jboss/aerogear/cordova/oauth2/OAuth2Plugin.java:22: error: package org.jboss.aerogear.android.core does not exist
[javac] import org.jboss.aerogear.android.core.Callback;
[javac] ^
[javac] /home/bleathem/workspace/cordova/hello/platforms/android/src/org/jboss/aerogear/cordova/oauth2/OAuth2Plugin.java:23: error: package org.jboss.aerogear.android.authorization does not exist
[javac] import org.jboss.aerogear.android.authorization.AuthzModule;
package.json:
...
"browser": {
"angular": "./lib/angular/angular.js",
....
},
"browserify-shim": {
"angular": {
"exports": "angular"
[]bleathem@redhat:~/workspace/visualCubeGenerator/backend (master *$>) $ curl -v http://localhost:9000/solve
* Hostname was NOT found in DNS cache
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 9000 (#0)
> GET /solve HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:9000
> Accept: */*
>
< HTTP/1.1 200 OK
@bleathem
bleathem / gist:d57ab0ca227f1dafb01c
Created October 3, 2014 19:31
The commit where I "got" javascript promises.
@@ -64,15 +64,7 @@
};
return function(authWindow) {
- var deferred = $q.defer();
- getCodePromise(authWindow).then(function(code) {
- getTokenPromise(code).then(function(data) {
- deferred.resolve(data);
- }, function(error) {
- deferred.reject(error);
[bleathem@sh-el6 mojarra]$ ant main clean main
Buildfile: /home/remote/bleathem/workspace/mojarra/build.xml
main:
[exec] [INFO] Scanning for projects...
[exec] [INFO]
[exec] [INFO] ------------------------------------------------------------------------
[exec] [INFO] Building Mojarra JSF Tools 2.2.6
[exec] [INFO] ------------------------------------------------------------------------
[exec] [INFO]
package org.richfaces.renderkit.html;
import java.io.IOException;
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import org.richfaces.renderkit.MessageForRender;
import org.richfaces.renderkit.MessageRendererBase;