Skip to content

Instantly share code, notes, and snippets.

View aviaviavi's full-sized avatar
🧣

Avi Press aviaviavi

🧣
View GitHub Profile
#!/bin/bash
function git_auto_stash_with_name() {
git stash save "autostash_$1"
}
function git_autostash_apply() {
stash_index="$(git stash list | grep "autostash_$1" | cut -d: -f1)"
if [ -n "$stash_index" ]; then
git stash pop
#!/bin/sh
PLATFORM=""
if [[ "$OSTYPE" == "linux-gnu" ]]; then
echo "Installing scarf on linux"
PLATFORM="linux"
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "Installing scarf on mac"
PLATFORM="mac"
{ linux_x86_64 = < Linux_x86_64 = {=} | MacOS : {} >
, mac = < MacOS = {=} | Linux_x86_64 : {} >
}
{ linux_i386 = < Linux_i386 = {=} | Linux_x86_64 : {} | MacOS : {} >
, linux_x86_64 = < Linux_x86_64 = {=} | Linux_i386 : {} | MacOS : {} >
, mac = < MacOS = {=} | Linux_i386 : {} | Linux_x86_64 : {} >
}
@aviaviavi
aviaviavi / ddp-node-example-payment-identify.js
Last active November 1, 2017 19:09
Getting started with the DotDashPay Node SDK (payment and identification)
var util = require("util")
var ddp = require("dotdashpay")
ddp.platform.initialize({
// We are now using real payment hardware (e.g. a Kiosk III)
environment: "PROCESSOR_SIMULATOR"
}).onInitialized(data => {
console.log("initialized")
processPayment(500)
}).onInitializeError(err => {
@aviaviavi
aviaviavi / ddp-node-example-payment.js
Last active November 1, 2017 00:08
Getting started with the DotDashPay Node SDK (payment only)
var util = require("util")
var ddp = require("dotdashpay")
ddp.platform.initialize({
// `environment` allows you to specify aspects of the payment pipeline you
// may want to mock out. “PROCESSOR_SIMULATOR” implies that calls to the
// payment processor will be mocked, but the rest of the interactions with
// the DotDashPay platform on your system work as they normally would. To
// mock out payment peripherals (eg. to simulate a card swipe) you can use
// the “PERIPHERAL_SIMULATOR” environment. If you want to mock out the
@aviaviavi
aviaviavi / keybase.md
Created October 5, 2017 16:35
keybase proof

Keybase proof

I hereby claim:

  • I am aviaviavi on github.
  • I am aviaviavi (https://keybase.io/aviaviavi) on keybase.
  • I have a public key ASBLHZq4SiM7cc6EM4_iJQbvgAmMQqw5Pc2jnXXnJHiAgAo

To claim this, I am signing this object: