Skip to content

Instantly share code, notes, and snippets.

View charlie-s's full-sized avatar

Charlie Schliesser charlie-s

  • CS Development
  • Saint Louis, Missouri, USA
  • 04:46 (UTC -05:00)
View GitHub Profile
@charlie-s
charlie-s / salesOrder-afterSubmit-createPos.js
Created May 21, 2021 18:22
NetSuite - Create Purchase Orders for out of stock qtys on Sales Order creation
/**
*@NApiVersion 2.1
*@NModuleScope Public
*@NScriptType UserEventScript
*/
define(['N/record'], function (record) {
return {
afterSubmit: function (context) {
const order = context.newRecord
const numLines = order.getLineCount({ sublistId: 'item' })

Originally pulled from https://gist.github.com/binhp/52e2254420a638d9da5c4cf33dde3c46, but I needed to patch in the SQS service.

Example usage:

define(['/SuiteScripts/ns-aws-sdk'], function (AWS) {
  const AWS_REGION = 'us-east-1'
  const AWS_ACCESS_KEY = '...'
  const AWS_SECRET_KEY = '...'
 const SQS_QUEUE_URL = 'https://sqs.us-east-1.amazonaws.com/1234567890/QueueName'
@charlie-s
charlie-s / s3_example.php
Created April 2, 2015 23:53
S3 PHP Example (without an SDK)
<?php
class S3 {
private $key = 'ABC123';
private $secret = 'lolftw';
private $region = 'us-west-2';
private $bucket = 'examplebucket';
private $host = 's3.amazonaws.com';
@charlie-s
charlie-s / gist:1175bf9374dbc83046e7
Created December 9, 2014 02:07
SVG Polygon Mask
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="300px" height="300px" viewBox="0 0 500 500">
<defs>
<clipPath id="clip1">
<polygon points="250,20 480,100 480,400 250,480 20,400 20,100"></polygon>
</clipPath>
</defs>
<polygon points="250,20 480,100 480,400 250,480 20,400 20,100" stroke="#aaaa99" stroke-width="30" stroke-linejoin="round"></polygon>
<image xlink:href="https://c2.staticflickr.com/4/3650/3513935402_a1d2a3db9b.jpg" width="500" height="500" clip-path="url(#clip1)"></image>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" width="60" height="34" tilewidth="16" tileheight="16">
<tileset firstgid="1" name="test" tilewidth="16" tileheight="16">
<tile id="0">
<image width="16" height="16" source="_block.png"/>
</tile>
<tile id="1">
<image width="16" height="16" source="_portal.png"/>
</tile>
</tileset>