Skip to content

Instantly share code, notes, and snippets.

View patrickhaley's full-sized avatar
🟢
Active

Patrick Haley patrickhaley

🟢
Active
View GitHub Profile
@patrickhaley
patrickhaley / code-editor-rules.md
Created February 5, 2025 14:40 — forked from yifanzz/code-editor-rules.md
EP12 - The One File to Rule Them All

[Project Name]

Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.

Project Context

[Brief description ]

  • [more description]
  • [more description]
  • [more description]
/**
* Using a single integer to represent multiple permissions
* based on binary values using bitwise operators
*
* & bitwise AND - if both the top and bottom bit are 1, result is 1
* | bitwise OR - if either the top and bottom bit or both are 1, result is 1
* ^ bitwise XOR - if only one of the bits are 1, result is 1
* 0101
* 0100 & = 0100
*
@patrickhaley
patrickhaley / prep-contacts.py
Created August 14, 2022 12:31 — forked from lrhazi/prep-contacts.py
Fix Contact Groups IDs
import csv,sys
# contact groups export from source account (CSV)
fn1=sys.argv[1]
# contact groups export from target account (CSV)
fn2=sys.argv[2]
# Exported contacts from source account
contacts_csv_fn=sys.argv[3]
# Exported contacts from source account (Corrected)
contacts_csv_fn2=sys.argv[4]
@patrickhaley
patrickhaley / copy-contacts.sh
Created August 14, 2022 12:30 — forked from lrhazi/copy-contacts.sh
Copy Google Workspace Contacts from one account to another
#!/bin/bash -x
shopt -s expand_aliases
alias gam='/root/bin/gamadv-xtd3/gam'
USER_SRC=$1
USER_DST=$2
CONTACTS_FN_SRC="/data/${USER_SRC}-contacts.csv"
CONTACTS_FN_DST="/data/${USER_DST}-contacts.csv"
CONTACTGROUPS_FN_SRC_CSV="/data/${USER_SRC}-contactgroups.csv"
CONTACTGROUPS_FN_SRC_JSON="/data/${USER_SRC}-contactgroups-json.csv"
@patrickhaley
patrickhaley / netsutie-parameters.js
Created April 30, 2018 21:53
PlaceThe following Javascript code must be placed at the bottom of each page in your website. It should not be placed inside any HTML tags and should be the last code before the </body> tag.
<!-- Pass URL Parameters to NetSuite -->
<!-- https://system.na3.netsuite.com/app/help/helpcenter.nl?fid=section_N979468.html -->
<script type="text/javascript">
<!--
function getNS_url_param( name ){
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
@patrickhaley
patrickhaley / In the body
Last active September 5, 2017 19:05
This line of code needs to be included before the </body> tag when integrating Google reCAPTCHA with NetSuite Forms.
<script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js”></script>
<script src=”https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js”></script>
@patrickhaley
patrickhaley / Before the form button
Created September 5, 2017 19:04
This line of code needs to be included before the form button inside the <form> tags when integrating Google reCAPTCHA with NetSuite Forms.
<div class=”g-recaptcha” data-sitekey=”YOUR_RECAPTCHA_SITE_KEY”></div>
@patrickhaley
patrickhaley / Place in the header
Created September 5, 2017 19:01
These lines of code need to be included before </head> when integrating Google reCAPTCHA with NetSuite Forms.
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<script src=”https://www.google.com/recaptcha/api.js”></script>
/* MIT License (MIT)
*
* Copyright (c) 2017 - Patrick Haley
* https://github.com/pshaley/netsuite-recaptcha/blob/master/netsuite_recaptcha_cs.js
*
* Original Author - Emil Olaguir, Jr.
* https://pulse.tips/google-recaptcha-for-netsuite-online-forms_58df6fb61723dda223accbef.html
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
<!DOCTYPE html>
<html>
<!--
Copyright (c) 2017 - Patrick Haley
https://github.com/pshaley/netsuite-recaptcha/blob/master/netsuite_recaptcha_online_form_template.html
http://www.bcsprosoft.com/blog/netsuite-forms-recaptcha/
Original Author - Benji Sicam
https://github.com/benjsicam/netsuite-recaptcha/blob/master/netsuite_recaptcha_online_form_template.html
-->