Skip to content

Instantly share code, notes, and snippets.

View davidtucker's full-sized avatar

David Tucker davidtucker

View GitHub Profile
@davidtucker
davidtucker / app.js
Created November 15, 2013 11:26
Sample Websockets Chat Server with Socket.IO
// Include Both Express and Socket.io
var express = require('express');
var socketIO = require('socket.io');
// Include the core modules for http and path
var path = require('path');
var http = require('http');
// Setup Express to serve static files from static directory
var app = express();
@davidtucker
davidtucker / example.html
Created November 19, 2013 21:47
Basic NVD3 Pie Chart
<html>
<head>
<link href="//cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.13-beta/nv.d3.min.css" rel="stylesheet"></link>
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.3.9/d3.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.13-beta/nv.d3.min.js"></script>
</head>
<body>
<div id="pieChart">
<svg></svg>
</div>
@davidtucker
davidtucker / AppDelegate.swift
Created May 11, 2017 01:16
Cognito Configuration with the AppDelegate
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// setup logging for AWS & Cognito
AWSDDLog.sharedInstance.logLevel = .verbose
AWSDDLog.add(AWSDDTTYLogger.sharedInstance)
// setup cognito config
self.cognitoConfig = CognitoConfig()
// setup cognito
setupCognitoUserPool()
@davidtucker
davidtucker / AppDelegate.swift
Created May 11, 2017 01:22
Cognito Delegate Implementation in AppDelegate.swift
extension AppDelegate: AWSCognitoIdentityInteractiveAuthenticationDelegate {
func startPasswordAuthentication() -> AWSCognitoIdentityPasswordAuthentication {
if(self.navigationController == nil) {
self.navigationController = self.window?.rootViewController as? UINavigationController
}
if(self.loginViewController == nil) {
self.loginViewController = self.storyboard?.instantiateViewController(withIdentifier: "LoginViewController") as? LoginViewController
}
@davidtucker
davidtucker / uuid_v4_excel_formula.txt
Created August 12, 2018 15:58 — forked from msubel/uuid_v4_excel_formula.txt
An Excel Fromula to generate a UUID v4
=LOWER(CONCATENATE(DEC2HEX(RANDBETWEEN(0;POWER(16;8));8);"-";DEC2HEX(RANDBETWEEN(0;POWER(16;4));4);"-";"4";DEC2HEX(RANDBETWEEN(0;POWER(16;3));3);"-";DEC2HEX(RANDBETWEEN(8;11));DEC2HEX(RANDBETWEEN(0;POWER(16;3));3);"-";DEC2HEX(RANDBETWEEN(0;POWER(16;8));8);DEC2HEX(RANDBETWEEN(0;POWER(16;4));4)))