Skip to content

Instantly share code, notes, and snippets.

View michoelchaikin's full-sized avatar

Michoel Chaikin michoelchaikin

View GitHub Profile
@michoelchaikin
michoelchaikin / swipe_cc.js
Last active May 30, 2018 16:26
Accept credit cards by swiping in NetSuite using USB credit card reader
/**
* Accept credit cards by swiping in NetSuite using USB credit card reader
* (http://www.ebay.com.au/sch/i.html?_nkw=Magnetic+Stripe+Swiper)
*
* To deploy:
*
* 1) Upload this file to File Cabinet
* 2) In your custom Sales Order form, add the script file (no need to associate with any events)
* 3) Add an 'Inline HTML' custom field to the form with default value:
* <a href="javascript:swipe_cc();">Swipe Credit Card</a>
@michoelchaikin
michoelchaikin / gist:fc4db078c0f64f6f5d35
Last active November 13, 2022 18:54
Backup a mySQL database to Google Drive
#! /usr/bin/perl
# Backups and compresses a SQL database, and uploads to Google Drive
# Make sure ~/.my.cnf is set with mySQL login credentials
# Follow instructions at https://developers.google.com/drive/web/auth/web-server to generate a client id and secret
# Use bash script at https://github.com/soulseekah/bash-utils/blob/master/google-oauth2/google-oauth2.sh to create refresh token
# Configuration Options
my $HOST = ''; # mySQL server host