Skip to content

Instantly share code, notes, and snippets.

@23maverick23
23maverick23 / refresh_dhcp_mac.sh
Created November 19, 2017 15:26
Renew Mac DHCP from Terminal
$ ifconfig
# choose your wifi connection - should
# be the only `active` status if you
# have that connected
$ sudo ipconfig set en1 DHCP
@23maverick23
23maverick23 / find_hashtag.sql
Created August 17, 2017 15:30
NS: Find hashtag in notes field
REGEXP_SUBSTR({custbody_salesops_addtional_remarks}, '#[[:alpha:][:punct:]]+', 1, 1, 'i')
@23maverick23
23maverick23 / regexp_listcomp_shortcut.py
Created February 11, 2017 15:58
Python: Regexp in list comprehension (shortcut syntax)
# Taken from Stack Overflow answer http://stackoverflow.com/a/2436623/4093021
import re
# items = ['[1] rymoio [rymoio 7s] foo bar', '[2] baz [rymoio 2d] hello world']
# assign matches to callable group parameters
regex = r"(?P<who>.*\[.*\]\s)(?P<what>.*)"
# bound method outside of the listcomp optimization
@23maverick23
23maverick23 / keybase.md
Created February 10, 2017 02:09
Keybase proof

Keybase proof

I hereby claim:

  • I am 23maverick23 on github.
  • I am rymoio (https://keybase.io/rymoio) on keybase.
  • I have a public key ASBZmPaOzAaRLVWFY1eGAr8ileLAoc1YkuHZoqsqU7JEHwo

To claim this, I am signing this object:

@23maverick23
23maverick23 / SuiteSolution_CreatePrjFromOppWA.ns.js
Created February 8, 2017 20:53
NS: Create Project from Opportunity (Workflow Action)
/**
* Copyright NetSuite, Inc. 2016 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.
*
* Create a basic project header using Opportunity fields.
*
* Version Date Author Remarks
@23maverick23
23maverick23 / SuiteSolution_OpenAirCreateCustomerPO.nsoa.js
Last active February 8, 2017 20:47
OA: SuiteSolution - OpenAir Create Customer PO
/**
* Allows for the creation of a new Customer PO record directly from the
* project properties form, and also auto-attaches the Customer PO to
* the currently selected Customer and Project.
*
* Version Date Author Remarks
* 1.00 27 Nov 2013 Ryan Morrissey
* 1.01 23 Feb 2016 Ryan Morrissey Added script parameters
*
*/
@23maverick23
23maverick23 / SuiteSolution_OpenAirRiskTag.nsoa.js
Last active December 21, 2018 16:30
OA: SuiteSolution - OpenAir Risk Tags
/* jshint shadow:true, curly:true, undef:true, quotmark:true, sub:true */
/* globals NSOA */
/**
* @name SuiteSolution: Risk Tags
* @copyright Oracle, Inc. 2017. All rights reserved.
* @version 1.0
*
* Create HTML elements of type TAG. These are based on the Bootstrap
* tag element which can be found here:
@23maverick23
23maverick23 / transmit_mount_as_disk.scpt
Created February 7, 2017 15:44
OSX: Auto-mount Transmit favorite as disk
-- Add the script as a login item to auto-mount Transmit favorite
tell application "Transmit"
set myFave to item 1 of (favorites whose name is "My Favorite")
tell current tab of (make new document at end)
connect to myFave with mount
close
end tell
end tell
@23maverick23
23maverick23 / oa_wsdl_to_json.py
Created January 27, 2017 02:16
OA: Parse OpenAir WSDL as JSON
import urllib2
try:
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
try:
import simplejson as json
except ImportError:
@23maverick23
23maverick23 / log_customer_phone_call.sql
Created January 5, 2017 19:33
NS: Log customer phone call
-- When used in a Formula (Text) column on a Customer
-- saved search, this opens a new tab to log a phone
-- call for a client.
'<img src="https://system.netsuite.com/uirefresh/img/recordicon/call.svg" style="width:15px"> <a href="/app/crm/calendar/call.nl?l=T&refresh=activities&invitee=' || {internalid} || '&company=' || {internalid} || '&xnew=T" target="_blank" class="dottedlink" style="vertical-align:top;">Log call to ' || {phone} || '</a>'