Skip to content

Instantly share code, notes, and snippets.

View carbonrobot's full-sized avatar

Charlie Brown carbonrobot

View GitHub Profile
const aws = require('aws-sdk');
const dynamoDB = new aws.DynamoDB({
region: 'us-east-1'
});
const tableName = 'benefitPlans-test';
const k = (lastEvaluatedKey) => {
const awsParams = {
TableName: tableName,
@carbonrobot
carbonrobot / ideal.js
Last active March 31, 2017 13:21
Hapi on Lambda
'use strict';
const Hapi = require('hapi'); // a very happy server
const config = require('./config'); // application configuration
const monitor = require('./monitor'); // Monitoring, logging
const api = require('./api'); // REST API
// get me a new happi server
const server = new Hapi.Server();
server.connection({ routes: { cors: true } });
@carbonrobot
carbonrobot / pobox-test.js
Created October 18, 2016 20:18
PO Box Regex
'use strict';
//var pattern = /\bbox(?:\b$|([\s|\-]+)?[0-9]+)|(p[\-\.\s]?o.?[\-\s]?|post office\s)b(\.|ox)?/i;
var pattern = /\bbox(?:\b$|([\s|\-]+)?[0-9]+)|(p[\-\.\s]*o[\-\.\s]*|(post office|post)\s)b(\.|ox|in)?\b|(^p[\.]?(o|b)[\.]?$)/i;
console.log('---- Checking invalid addresses ---');
var invalid = [
'po box',
'p.o.b.',
@carbonrobot
carbonrobot / matrix.md
Last active March 29, 2016 02:15
css decision matrix

Using bootstrap less VS css

Advantages

  • Allows us to pick and choose parts of boostrap more easily
  • Allows us to keep bs3 specific classes out of html
  • Easier to create ng2 components

Disadvantages

@carbonrobot
carbonrobot / install.sh
Created March 22, 2016 21:07
Script for install rhel/centos tools for nodejs and docker development
sudo yum update -y
curl -fsSL https://get.docker.com/ | sh
sudo usermod -aG docker your-user
sudo service docker start
sudo chkconfig docker on
curl --silent --location https://rpm.nodesource.com/setup_5.x | bash -
yum -y install nodejs gcc-c++ make git
@carbonrobot
carbonrobot / docker-cheat-sheet.md
Last active March 22, 2016 18:08
Docker Cheat Sheet

Common Docker Commands

Build and name an image

docker build -t <imagename>:<optionaltag> <working directory>
docker build -t centos:v11.0 .
docker build -t rhel .
docker build -t centos:v12 ./rhel
@carbonrobot
carbonrobot / styleguide.md
Last active March 15, 2016 18:59
Styleguide for Optum Portals

Style Guidelines

The following guidelines for style development are intended to be flexible enough to cover most of our development, but are not set in stone. They provide a starting point for a common development pattern throughout the organization and our constantly evolving to meet the needs of new projects, technology, and team dynamics.

Although we borrow heavily from concepts such as ITCSS and SMACSS, this guideline is also influenced by Bootstrap (which we base our styles on top off) and concepts from OOCSS and BEM.

Layers

<html>
<head>
<style>
.input-terms {
display:block;
padding: 7px 3px;
margin-bottom: 10px;
width: 80%;
display: none;
// this is your contacts form code
public class ContactsView {
private Service _service;
private Contact _contact;
public ContactsView(){
_service = new Service();
}
public void loadContact(int contactId){
@carbonrobot
carbonrobot / angular-session.js
Created December 16, 2015 01:12
Angular Session Timeout Srvice
angular.module('ofs.session', [])
.factory('ofsSession', ofsSession);
function ofsSession($rootScope, $interval, $document) {
var _options = {
idle: 10,
timeout: 10,
interrupt: 'mousemove keydown DOMMouseScroll mousewheel mousedown touchstart touchmove scroll'
};
var _onStateChanged = null;