Skip to content

Instantly share code, notes, and snippets.

@23maverick23
23maverick23 / notion_days_until_due.txt
Last active June 18, 2020 13:47
Notion: Days Until Due
if(empty(prop("Due Date")), "N/A", if(dateBetween(prop("Due Date"), now(), "days") + 1 < 0, "Past Due", if(dateBetween(prop("Due Date"), now(), "days") + 1 == 0, "Today", if(dateBetween(prop("Due Date"), now(), "days") + 1 == 1, "Tomorrow", format(dateBetween(prop("Due Date"), now(), "days") + 1) + " days"))))
@23maverick23
23maverick23 / nodemon_heroku_local.sh
Created January 3, 2020 00:04
Reload Heroku local on any file change
# https://stackoverflow.com/questions/34146236/restart-heroku-local-on-file-change
nodemon --exec "heroku local" --signal SIGTERM
@23maverick23
23maverick23 / hashtags_find.sql
Created November 13, 2019 18:58
NS: Only display hashtags
REGEXP_REPLACE({your_text_field}, '(#\S+\s?)|.', '\1', 1, 0)
@23maverick23
23maverick23 / b-mind.theme
Last active October 16, 2019 13:58
Custom Slack Themes
#1d1d1d,#000000,#0ba8ca,#FFFFFF,#075566,#FFFFFF,#0ba8ca,#EB4D5C
@23maverick23
23maverick23 / date_to_text.sql
Last active February 2, 2022 20:39
NS: Convert Date Month to Sortable With Text (SuiteAnalytics Workbook)
-- Format a date field in SuiteAnalytics Workbook so that it sorts by month but displays month name
TO_CHAR({date_field}, 'MM') || '-' || TO_CHAR({date_field}, 'MON')
@23maverick23
23maverick23 / project_card_view.sql
Created May 8, 2019 18:03
NS: Project Card View saved search field
'
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css" />
<div class="ui card" style="width:600px;">
<div class="content">
<div class="right floated meta"><i class="user circle icon"></i> ' || {custentity_atlas_svs_em_pm_list} || '</div>
<div class="header">' || {entityid} || ' ' || {jobname} || '</div>
<div class="meta">' || {customer} || '</div>
</div>
<div class="content">
<div class="ui three mini statistics">
@23maverick23
23maverick23 / postSlackMessage.oa.js
Created April 29, 2019 14:42
OA: Post message to Slack via webhook
/*
SLACK INCOMING WEBHOOKS REFERENCE
> https://api.slack.com/incoming-webhooks
SLACK MESSAGE ATTACHMENT REFERENCE
> https://api.slack.com/docs/message-attachments
*/
@23maverick23
23maverick23 / afterSaveSendEmail.oa.js
Created March 2, 2019 02:06
OA: Send email on resource request
/**
* The first time a value is selected it should generate an email
* to the original submitter to let them know the status of the
* request has been changed and indicate the new status. IF the
* value of that field changes again, then another email needs to
* be sent indicating the change from one status to another. Also,
* if the email can grab any notes that are in the notes field
* that would be great.
*
* @param {String} type Form event type.
@23maverick23
23maverick23 / sc_forecast_card.html
Last active March 5, 2019 17:38
NS: SC Forecast Report
<div class="ui raised ' || CASE {custrecord_screq_engmnt_status} WHEN 'Not Started' THEN 'grey' WHEN 'In Progress' THEN 'blue' WHEN 'On hold' THEN 'orange' WHEN 'Completed' THEN 'olive' WHEN 'Cancelled' THEN 'red' END || ' card" style="min-width:450px;">
<div class="content">
<div class="right floated meta">
<a class="ui ' || CASE {custrecord_screq_engmnt_status} WHEN 'Not Started' THEN 'grey' WHEN 'In Progress' THEN 'blue' WHEN 'On hold' THEN 'orange' WHEN 'Completed' THEN 'olive' WHEN 'Cancelled' THEN 'red' END || ' tiny label" style="white-space:nowrap !important;">' || {custrecord_screq_engmnt_status} || '</a>
</div>
<div class="header">' || {custrecord_screq_assignee} || ' </div>
<div class="meta">' || CASE WHEN {custrecord_screq_assigned_lead} = 'T' THEN 'Lead SC' ELSE 'Secondary SC' END || '</div>
</div>
<div class="content">
<div class="right floated meta">' || CASE WHEN TO_DATE(REGEXP_SUBSTR({custrecord_screq_engmnt_notes}, '\d{1,2}/\d{1
@23maverick23
23maverick23 / apps.lua
Created October 1, 2018 14:57
OSX: Hammerspoon scripts
apps = {}
apps.launchers = {
{
name="Home - Coding",
description="Launch apps for coding.",
apps={
"Sublime Text",
"iTerm",
"Dash"