Skip to content

Instantly share code, notes, and snippets.

View leecardona's full-sized avatar
🏠
Chillin at home

Lee Cardona leecardona

🏠
Chillin at home
View GitHub Profile
#Copyright (C) 2014 Marc Herndon
#
#This program is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License,
#version 2, as published by the Free Software Foundation.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#Copyright (C) 2014 Marc Herndon
#
#This program is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License,
#version 2, as published by the Free Software Foundation.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
/* ====================================================================
* File: scale.js
* Authors: Lee Cardona
* Copyright (c) 2016 Nuvem Newtworks Inc. All rights reserved.
* ====================================================================
*/
var scale = {
init : function () {
scale.setValues()
@leecardona
leecardona / HTTPS CLIENT PATTERN
Created May 6, 2014 01:58
NODEJS HTTPS CLIENT REQUEST PATTERN
//HTTPS CLIENT REQUEST OPTIONS
HTTPSClient['requestBody' ] = {}
HTTPSClient['requestOptions'] = {}
HTTPSClient['requestOptions']['host' ] = ''
HTTPSClient['requestOptions']['port' ] = 443
HTTPSClient['requestOptions']['path' ] =
HTTPSClient['requestOptions']['method' ] =
HTTPSClient['requestOptions']['headers'] =
HTTPSClient['requestOptions']['headers']['Content-Type' ] = 'application/json'
HTTPSClient['requestOptions']['headers']['Content-Length'] = HTTPSClient.byteCount(JSON.stringify(HTTPSClient['requestBody']))
@leecardona
leecardona / RegEx for HTTP Status Codes
Created May 4, 2014 17:25
Javascript Regular Expression for valid HTTP Status Codes
//DEFINE REGEX - valid input range is 100 thru 599
var regEx = /^[1-5][0-9][0-9]$/
//TEST REGEX
regEx.test(99)
=>false
regEx.test(100)
=>true
@leecardona
leecardona / HelloWorld.js
Created September 18, 2012 15:46
Hello Gist
(function sayHello(){
console.log('\nHello World\n');
})();