This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; moose-functions.el --- Assortment of functions I find useful. -*- lexical-binding: t; -*- | |
;; Copyright (C) 2018 Christopher David Ramos | |
;; Author: Christopher David Ramos <[email protected]> | |
;; Keywords: convenience | |
;;; Commentary: | |
;;; shout out to https://emacs.stackexchange.com/a/358 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (C) 2018 Christopher David Ramos | |
export function _Card(data) { | |
const objCardBuilder = Object.create(objCardMethods) | |
const card = CardService.newCardBuilder() | |
const cardHeader = CardService.newCardHeader() | |
if (data.name) { | |
card.setName(data.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.capitalize = function() { | |
return this.charAt(0).toUpperCase() + this.slice(1) | |
} | |
String.prototype.toTitleCase = function() { | |
const arrSentence = this.toLowerCase().split(" ") | |
arrSentence.forEach((word, index, arr) => { | |
if (word.length > 3) { | |
arr[index] = word.charAt(0).toUpperCase() + word.slice(1) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
By default, it's a bad idea to store component heavy projects in an iCloud syncronized directory as the frequent shuffling of hundreds of files puts a heavy burden on the sync service. Moreover, it gets in the way of keeping the important stuff syncronized. | |
Let's say your project structure looks like this: | |
~/Documents/project/ | |
└── node_modules | |
Let's adopt it accordingly: | |
~/Documents/project/ | |
└── modules.noSync | |
└── node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function WeatherIconService(WxCondition, isDaytime) { | |
// https://www.weather.gov/bgm/forecast_terms | |
// POP Percent Expression of Uncertainty Equivalent Areal Qualifier | |
// 10 percent (none used) Isolated/ Few | |
// 20 percent Slight Chance Widely Scattered | |
// 30, 40, & 50 percent Chance Scattered | |
// 60 & 70 percent Likely Numerous (or none used) | |
// 80, 90, & 100 percent (None used) Occasional, periods of, or none used | |
const TIME = isDaytime ? "DAY" : "NIGHT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function WeatherIconService(WxCondition, isDaytime) { | |
// https://www.weather.gov/bgm/forecast_terms | |
// POP Percent Expression of Uncertainty Equivalent Areal Qualifier | |
// 10 percent (none used) Isolated/ Few | |
// 20 percent Slight Chance Widely Scattered | |
// 30, 40, & 50 percent Chance Scattered | |
// 60 & 70 percent Likely Numerous (or none used) | |
// 80, 90, & 100 percent (None used) Occasional, periods of, or none used | |
const TIME = isDaytime ? "DAY" : "NIGHT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.3.1-apache | |
RUN docker-php-ext-install mysqli pdo_mysql pdo && \ | |
docker-php-ext-enable mysqli pdo_mysql pdo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const transitionToPromise = (el, property, value) => | |
new Promise(resolve => { | |
el.style[property] = value; | |
const transitionEnded = e => { | |
if (e.propertyName !== property) return; | |
el.removeEventListener('transitionend', transitionEnded); | |
resolve(); | |
} | |
el.addEventListener('transitionend', transitionEnded); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// browser detect | |
var BrowserDetect = { | |
init: function() { | |
this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; | |
this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; | |
this.OS = this.searchString(this.dataOS) || "an unknown OS"; | |
}, | |
searchString: function(data) { | |
for (var i = 0; i < data.length; i++) { | |
var dataString = data[i].string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// note that you'll need to edit out variables for this to work. Also, this isn't guaranteed to work! | |
@mixin moose-tooltip($message) { | |
position: relative; | |
display: inline-block; | |
text-decoration: underline dotted $oc-blue-3; | |
&::before { | |
opacity: 0; | |
} | |
&:hover::before { |