Skip to content

Instantly share code, notes, and snippets.

View skbailey's full-sized avatar

Sherard Bailey skbailey

View GitHub Profile
@skbailey
skbailey / lambda_proxy.go
Last active May 31, 2021 07:57
Simple Lambda Proxy example
package main
import (
"encoding/json"
"log"
"net/http"
"time"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
@skbailey
skbailey / generate_screening_files.rb
Last active May 13, 2019 19:16
Generates Screening Configuration Data
#!/usr/bin/env ruby
# Sample usage: form_id=form_id config_csv=nccare360_configuration.csv ./generate_screening_files.rb
require 'pg'
require 'csv'
# require 'pry'
# Database Configuration
"use strict";
let PromiseFactory = (message) => {
return new Promise((resolve, reject) => {
setTimeout(() => resolve(message), 2000)
})
}
PromiseFactory("Ready!")
.then((value) => {
@skbailey
skbailey / recursion.js
Created March 14, 2016 02:52
Examples of Recursion
var factorial = function(num) {
if (num < 2) {
return 1;
}
return num * factorial(num - 1);
};
var isPalindrome = function (expression) {
// A single character string eg 'a' and the empty string "" are palindromes
@skbailey
skbailey / array_subset
Created April 14, 2012 17:49
Find out whether an array is a subset of another array
Array.property.subset = function(arr){ return _.all(arr, function(value){ return this.indexOf(value) !== -1; }, this); }