Skip to content

Instantly share code, notes, and snippets.

@kmoe
kmoe / client.go
Created September 21, 2016 14:41 — forked from jzelinskie/client.go
grpc bidirectional streams in golang
package main
import (
"log"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc"
pb "github.com/jzelinskie/grpc/simple"
@kmoe
kmoe / echoHttpRequest.js
Last active August 29, 2015 14:27 — forked from Marak/echoHttpRequest.js
Echo HTTP requests
module['exports'] = function echoHttp (hook) {
console.log("Console messages are sent to /logs");
console.log(hook.params);
console.log(hook.req.path);
console.log(hook.req.method);
@kmoe
kmoe / isTheWebsiteDown.js
Last active August 29, 2015 14:09 — forked from Marak/isTheWebsiteDown.js
Checks to see if a website is down
var http = require('http');
module['exports'] = function isTheWebSiteDown (hook) {
http.get(hook.params.url, function(res){
hook.debug(hook.params.url + " is up and running.")
hook.res.end('false');
}).on('error', function (){
hook.debug(hook.params.url + " is DOWN!")
hook.res.end('true');
});