Skip to content

Instantly share code, notes, and snippets.

@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"
@23maverick23
23maverick23 / karabiner.json
Created October 1, 2018 14:51
OSX: Karabiner Elements config file
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": true
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@23maverick23
23maverick23 / setProjectRiskInformation.nsoa_solution.xml
Created September 17, 2018 18:55
OA: Demo Solution - OpenAir Project Risk Indicator
<platform_solution><objects><form_script><parameters></parameters><name>setProjectRiskInformation.js</name><association>project_edit_form</association><event>after_save</event><libraries></libraries><comments></comments><code><![CDATA[/**
* Copyright NetSuite, Inc. 2014 All rights reserved.
* The following code is a demo prototype. Due to time constraints of a demo,
* the code may contain bugs, may not accurately reflect user requirements
* and may not be the best approach. Actual implementation should not reuse
* this code without due verification.
*
* Set the risk profile of a project using a custom field.
*
* Version Date Author Remarks
@23maverick23
23maverick23 / calculateBudgetBillRate.nsoa.js
Last active April 4, 2018 15:33
NSOA: Calculate project budget bill rate
/**
* Main entrance function (afterSave)
*/
function main(type) {
var DECIMALS = 2;
var FLD_RATE = 'budget_rate__c';
var needsUpdate = false;
var newRec = NSOA.form.getNewRecord();
@23maverick23
23maverick23 / netsuite_date_diff_biz_days.sql
Created February 26, 2018 18:29
NS: Date Difference Buisness Days
# Calculate Business Days (does not include start date)
CASE WHEN (TO_CHAR({systemnotes.date},'J') - TO_CHAR({created},'J'))+1 - ((((TRUNC({systemnotes.date},'D'))-(TRUNC({created},'D')))/7)*2) - (CASE WHEN TO_CHAR({created},'DY','nls_date_language=english')='SUN' THEN 1 ELSE 0 END) - (CASE WHEN TO_CHAR({systemnotes.date},'DY','nls_date_language=english')='SAT' THEN 1 ELSE 0 END) = 1 THEN 'Same Day' WHEN (TO_CHAR({systemnotes.date},'J') - TO_CHAR({created},'J'))+1 - ((((TRUNC({systemnotes.date},'D'))-(TRUNC({created},'D')))/7)*2) - (CASE WHEN TO_CHAR({created},'DY','nls_date_language=english')='SUN' THEN 1 ELSE 0 END) - (CASE WHEN TO_CHAR({systemnotes.date},'DY','nls_date_language=english')='SAT' THEN 1 ELSE 0 END) = 2 THEN 'Next day' ELSE CONCAT((TO_CHAR({systemnotes.date},'J') - TO_CHAR({created},'J'))+1 - ((((TRUNC({systemnotes.date},'D'))-(TRUNC({created},'D')))/7)*2) - (CASE WHEN TO_CHAR({created},'DY','nls_date_language=english')='SUN' THEN 1 ELSE 0 END) - (CASE WHEN TO_CHAR({systemnotes.date},'DY','nls
@23maverick23
23maverick23 / ssh_with_rsub.sh
Created January 28, 2018 04:43
Raspi: SSH with rsub
# https://stackoverflow.com/a/19236791
ssh pi@ip_address -R 52698:localhost:52698
# to open a file in Sublime Text
rsub filename.txt
@23maverick23
23maverick23 / force_nano_crontab.sh
Created January 27, 2018 23:37
Raspi: Force nano for crontab
export VISUAL=nano; crontab -e
@23maverick23
23maverick23 / python_overcast_sonos.sh
Last active December 11, 2017 02:41
Raspi: Terminal-less python instance
# run python terminal-less in the background
$ nohup python overcast-sonos.py
# to find the PID, run this
$ pgrep -f "overcast"
# to kill the process, run this
$ pkill -f "overcast"
@23maverick23
23maverick23 / raspi_storage_space.sh
Last active December 10, 2017 18:49
Raspi: Storage space
# Human readable output flag
$ df -h
# Filesystem Size Used Avail Use% Mounted on
# /dev/root 6.0G 4.4G 1.4G 76% /
# devtmpfs 428M 0 428M 0% /dev
@23maverick23
23maverick23 / fancy_terminal_style.less
Created December 3, 2017 00:12
LESS: Fancy terminal styling for code blocks
.pre-block
{
background: @terminal;
.border-radius(6px);
padding: 1px 20px;
margin: 40px auto;
width: 500px;
.box-shadow(0px 1px 8px darken(@white, 30));
position: relative;
color: @white;