Skip to content

Instantly share code, notes, and snippets.

💭
For hire

Chris paxperscientiam

💭
For hire
Block or report user

Report or block paxperscientiam

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View svg2icons.sh
#!/usr/bin/env bash
function finish {
echo "I am complete."
}
trap finish EXIT
function rekt {
echo "Canceled."
exit
}
trap rekt SIGINT
View moose-functions.el
;;; moose-functions.el --- Assortment of functions I find useful. -*- lexical-binding: t; -*-
;; Copyright (C) 2018 Christopher David Ramos
;; Author: Christopher David Ramos <ramos@Jupiter.local>
;; Keywords: convenience
;;; Commentary:
;;; shout out to https://emacs.stackexchange.com/a/358
@paxperscientiam
paxperscientiam / CardService.ts
Last active Feb 17, 2019
Wrapper function for GAS CardService.newCardBuilder
View CardService.ts
// 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)
View String.ts
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)
}
@paxperscientiam
paxperscientiam / adopting-component-heavy-projects-for-iCloud
Last active Feb 16, 2019
[Pro-tip][macOS][iCloud] Renaming components directories for compatibility with iCloud on macOS ~10.14
View adopting-component-heavy-projects-for-iCloud
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
View fasdf.ts
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"
View fasdf.ts
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"
View web.dockerfile
FROM php:7.3.1-apache
RUN docker-php-ext-install mysqli pdo_mysql pdo && \
docker-php-ext-enable mysqli pdo_mysql pdo
@paxperscientiam
paxperscientiam / transitionToPromise.js
Created Dec 12, 2018 — forked from davej/transitionToPromise.js
Do a CSS transition and resolve promise when complete
View transitionToPromise.js
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);
});
@paxperscientiam
paxperscientiam / browser_detect.js
Created Dec 11, 2018 — forked from 2107/browser_detect.js
JavaScript: Detect Browser
View browser_detect.js
// 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;
You can’t perform that action at this time.