Skip to content

Instantly share code, notes, and snippets.

View keegandonley's full-sized avatar
:octocat:
building

Keegan Donley keegandonley

:octocat:
building
View GitHub Profile
@keegandonley
keegandonley / utils.js
Created June 7, 2018 02:45
getSpeakableEmail
/**
* Converts .edu emails to an SSML string
* @param {String} email email address to be converted
* @return {String} email in SSML form
*/
export function getSpeakableEmail(email) {
const tld = email.indexOf('.edu');
if (tld >= 0) {
const body = email.slice(0, tld);
return `${body}<say-as interpret-as="spell-out">.edu</say-as>`;
const { exec } = require('child_process');
const functions = [
'createSession',
'getGeneralResources',
'getFireResources',
'getMeaning',
'receiveMeaning',
'getHousingResources',
'receiveEmail',
@keegandonley
keegandonley / lambdaDeploy.js
Last active April 12, 2018 17:31
Auto-deploy to lambda
const { exec } = require('child_process');
const functions = [
'createSession',
'getGeneralResources',
'getFireResources',
'getMeaning',
'receiveMeaning',
'getHousingResources',
'receiveEmail',
@keegandonley
keegandonley / update.js
Created April 23, 2017 05:56
Update HTML elements with vanilla JS
var elem = document.getElementsByClassName('container')[0];
var header = document.createElement("div");
var size = document.createElement("h1");
var inner = document.createTextNode("Title Here");
size.appendChild(inner);
header.appendChild(size);
header.appendChild(document.createElement("hr"))
elem.insertBefore(header, elem.firstChild);
@keegandonley
keegandonley / 3tablejoin.sql
Last active April 9, 2017 21:57
CS 355 Project 1
-- Gets the number of different technologies in a specific project
SELECT c.ID, c.first_name, c.last_name, count(tech_name) as num_technologies from clients c
RIGHT JOIN client_project cp on c.ID=cp.client_id
LEFT JOIN project_technology pt on cp.project_id=pt.project_id
group by c.ID;
@keegandonley
keegandonley / Review.md
Last active October 17, 2016 17:01
Midterm 1 Review for CS 10

##Midterm 1 Review

What is a statement in C++ that begins with a ‘#’?
What is used to display information on the screen?
What two types of data are used to store numbers?
What will the following blocks of code display?

<div class="container">
<div class="row">
<div class="col-sm-12 col-md-6 col-lg-3"><p>1</p></div>
<div class="col-sm-12 col-md-6 col-lg-3"><p>1</p></div>
<div class="col-sm-12 col-md-6 col-lg-3"><p>1</p></div>
<div class="col-sm-12 col-md-6 col-lg-3"><p>1</p></div>
</div>
</div>
@keegandonley
keegandonley / bobp-python.md
Created November 27, 2015 02:58 — forked from ksindi/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@keegandonley
keegandonley / data.js
Last active August 29, 2015 14:27
Highcharts Funnel Data Format
series: [{
name: "sample data",
data: [
[name,count],
[name,count],
[name,count],
etc…
]
}]
@keegandonley
keegandonley / getfiles.php
Created August 12, 2015 05:59
Return list of files in a directory
<?php
$images = array();
$dir = opendir('../img/easyPhotoGallery/');
while (($file = readdir($dir)) !== false)
{
if (substr($file,0,1) !== ".") { //Ignore system files
$images[] = $file;
}