Skip to content

Instantly share code, notes, and snippets.

@magicaltrevor
magicaltrevor / isTheWebsiteDown.js
Last active August 29, 2015 14:08 — forked from Marak/isTheWebsiteDown.js
Checks to see if a website is down
var http = require('http');
var urlparams = '/api/hermes_msoe_prod/systems/listSystemItems/{"system":"curriculog","id":"18","itemType":"core","template":"True"}';
module['exports'] = function isTheWebSiteDown (hook) {
http.get(hook.params.url + urlparams, function(res){
hook.debug(hook.params.url + urlparams + " is up and running.")
hook.res.end(hook.res.read());
}).on('error', function (){
hook.debug(hook.params.url + urlparams + " is DOWN!")
hook.res.end('true');
@magicaltrevor
magicaltrevor / windows.h__.js
Created November 18, 2012 23:59
windows.h.js INFINITY
var ffi = require('ffi'),
ref = require('ref'),
Struct = require('ref-struct'),
Library = require('./Library'),
Type = ref.Type,
NULL = ref.NULL,
isNull = ref.isNull;
var groups = ['libs', 'types', 'structs', 'callbacks', 'enums'];