Skip to content

Instantly share code, notes, and snippets.

@cafeasp
cafeasp / Suitelet-CloseSalesOrder.js
Created July 24, 2019 10:11
NetSuite-Suitelet Suite Script Close Sales Order
/**
* @NApiVersion 2.x
* @NScriptType Suitelet
* @NModuleScope SameAccount
*/
define(['N/file', 'N/record', 'N/redirect', 'N/search', 'N/ui/serverWidget', 'N/runtime', 'N/email'],
/**
* @param {file} file
* @param {record} record
* @param {redirect} redirect
@cafeasp
cafeasp / restlet_item_fulfillment.js
Created July 15, 2019 17:08
NetSuite - Suite Script Create Item Fulfillment
/**
* @NApiVersion 2.x
* @NScriptType Restlet
* @NModuleScope SameAccount
*/
define(['N/search', 'N/record', 'N/util', './momentjs.js', './cafeaspMagento.js'],
/**
* @param {search} search
* @param {record} record
* @param {util} util
@iloveitaly
iloveitaly / netsuite_autobill_sales_order.js
Last active August 11, 2020 02:22
Automatically bill NetSuite sales orders when the deposit total is enough to pay the order. http://SuiteSync.io/
/*
Author: <mike@suitesync.io>
Description: Automatically bills sales orders (creates invoices) when the deposit
total is enough to pay the order. This ensures the sales order is only
billed when the resulting invoice would be paid in full.
Link: https://gist.github.com/iloveitaly/eb3fffa67c5ea08010d3de6e552f84d3
Installation:
1. https://system.sandbox.netsuite.com/app/common/scripting/uploadScriptFile.nl
2. User Event
@jarretmoses
jarretmoses / React Native Clear Cache
Last active March 11, 2024 10:20
Clearing the Cache of your React Native Project
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.63 - watchman watch-del-all && rm -rf node_modules && npm install && rm -rf /tmp/metro-* && npm run start --reset-cache
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache
@the1sky
the1sky / gaode-poitype-map.js
Created May 30, 2016 09:46
高德POI类型描述映射
module.exports = {
'100000': '住宿服务;住宿服务相关;住宿服务相关',
'100100': '住宿服务;宾馆酒店;宾馆酒店',
'100101': '住宿服务;宾馆酒店;六星级及以上宾馆',
'100102': '住宿服务;宾馆酒店;五星级宾馆',
'100103': '住宿服务;宾馆酒店;四星级宾馆',
'100104': '住宿服务;宾馆酒店;三星级宾馆',
'100105': '住宿服务;宾馆酒店;经济型连锁酒店',
'100200': '住宿服务;旅馆招待所;旅馆招待所',
'100201': '住宿服务;旅馆招待所;青年旅舍',
@imwilsonxu
imwilsonxu / app.py
Last active February 16, 2023 04:57
[Flask + Wtforms + Select2] #flask
# -*- coding: utf-8 -*-
from flask import Flask, request, render_template, current_app
from flask_wtf import Form
from wtforms.validators import DataRequired
from wtforms import SelectField, SelectMultipleField, SubmitField
app = Flask(__name__)
@digilist
digilist / delay.sh
Created June 2, 2015 14:29
Delaying network traffic to a specific IP
#!/bin/bash
interface=lo
ip=10.0.0.1
delay=100ms
tc qdisc add dev $interface root handle 1: prio
tc filter add dev $interface parent 1:0 protocol ip prio 1 u32 match ip dst $ip flowid 2:1
tc qdisc add dev $interface parent 1:1 handle 2: netem delay $delay
@drblue
drblue / fix_onedrive.sh
Last active April 16, 2024 21:54
Fix OneDrive for Mac CPU usage
#!/bin/bash
## Fix OneDrive for Mac CPU usage
##
## Seems this is still a problem 5 years later after I created this little gist.
## I have long since stopped using OneDrive (luckily), but according to
## comments below, I have added the new path for OfficeFileCache for macOS
## Mojave (10.14) and Catalina (10.15).
## Run this on macOS Mojave (10.14) and Catalina (10.15)
find ~/Library/Containers/ -type d -name OfficeFileCache -exec rm -r {} +
@vladimirtsyupko
vladimirtsyupko / gist:10964772
Created April 17, 2014 08:32
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master