Skip to content

Instantly share code, notes, and snippets.

View kmcconnell's full-sized avatar
💭
Always up to something. 😉

Kane McConnell kmcconnell

💭
Always up to something. 😉
View GitHub Profile
@kmcconnell
kmcconnell / bootstrap.sh
Created August 7, 2016 07:39
AimiPHP Vagrant Bootstrap
#!/bin/bash
echo '### Updating installed packages...'
apt-get update
apt-get upgrade -y
echo '### Installing Apache...'
apt-get -y install apache2
sed -i -e 's/\/var\/www\/html/\/var\/www\/public/g' /etc/apache2/sites-available/000-default.conf
if [ -f /var/www/html/index.html ]; then
@kmcconnell
kmcconnell / ellipse_span.js
Created May 17, 2017 11:51
Truncate long text within a span.
/**
* Truncate long text within a span. Hover over span to see full text.
*
* @param {string} data The text content to include between span elements if longer
* than the specified maximum characters.
* @param {integer} chars The maximum number of characters before truncating with an
* ellipse.
*
* @return {string} The ellipsed span with the full text set as the title attribute if
* the specified data is greater than the max characters, otherwise
@kmcconnell
kmcconnell / convert_to_date_object.js
Created May 17, 2017 11:56
Convert an argument representing a datetime into a Date object.
/**
* Converts an argument representing a datetime into a Date object.
*
* @param {string|number|Date} time Argument representing a datetime.
*
* @return {Date} The Date object representing the specified datetime.
*/
function convert_to_date_object(time)
{
switch (typeof time) {
@kmcconnell
kmcconnell / interval_duration.js
Last active May 17, 2017 12:00
Render time interval in easy-to-read string.
/**
* Compares two datetime values and returns a human-readable interval in past or
* future tense.
*
* @param {string|number|Date} start The first (from) datetime to use in comparison.
* @param {string|number|Date} stop The second (to) datetime to use in comparison.
*
* @example "6 seconds ago"
*
* @return {string} The interval statement.
@kmcconnell
kmcconnell / cla-individual.html
Last active January 13, 2019 17:07
makanaltech-cla-individual
<p><strong>Individual Contributor License Agreement (“Agreement”) v19.2.1-en</strong></p>
<p>Makánal Technológia és Szoftver Fejlesztés Kft. (“Makánal Tech” or “We” or “Us”), a limited
liability company duly organised under Hungarian law with its registered office in
Budapest, Hungary; UID/VAT: HU25854617</p>
<p>Thank you for your interest in contributing to Makánal Tech. This Agreement documents the
rights granted by Contributors to Makánal Tech. <strong>To make this document effective, please
complete the form at the bottom of this page.</strong></p>
<p><strong>Individual Contributor Assignment Agreement (“Agreement”) v19.2.1-en</strong></p>
<p>Makánal Technológia és Szoftver Fejlesztés Kft. (“Makánal Tech” or “We” or “Us”), a limited
liability company duly organised under Hungarian law with its registered office in
Budapest, Hungary; UID/VAT: HU25854617</p>
<p>Thank you for your interest in contributing to Makánal Tech. This Agreement documents the
rights granted by Contributors to Makánal Tech. <strong>To make this document effective, please
complete the form at the bottom of this page.</strong></p>