Skip to content

Instantly share code, notes, and snippets.

View lasergoat's full-sized avatar

Daniel lasergoat

  • Fattmerchant
  • US
View GitHub Profile
@javidjasmine
javidjasmine / Copy Payment Method.md
Last active February 16, 2021 17:20
Guidance on using a Spreedly receiver to "duplicate" a payment method

In this doc, "source" indicates the customer/merchant that is controlling the user experience and is receiving the payment method data from the customer. "Target" is the partner that wishes to receive this payment method from the source. If you wish to use this method to essentially copy a payment method within your environment, you will act as both the "source" and the partner".

Note: this example uses XML, but the JSON API is recommended.

$ curl https://core.spreedly.com/v1/receivers.xml \
  -u '[SOURCE-ENV-KEY]:[SOURCE-SECRET]' \
  -H 'Content-Type: application/xml' \
  -d '<receiver>
 spreedly
@jcouyang
jcouyang / README.org
Last active May 31, 2024 14:30
Promise All with Limit of Concurrent N

The Promise All Problem

in case of processing a very large array e.g. Promise.all(A_VERY_LARGE_ARRAY_OF_XHR_PROMISE)

which would probably blow you browser memory by trying to send all requests at the same time

solution is limit the concurrent of requests, and wrap promise in thunk

Promise.allConcurrent(2)([()=>fetch('BLAH1'), ()=>fetch('BLAH2'),...()=>fetch('BLAHN')])

@magnetikonline
magnetikonline / README.md
Last active June 7, 2023 20:57
AWS Elastic Beanstalk deploy user restricted IAM policy.

AWS Elastic Beanstalk deploy user restricted IAM policy

An IAM user policy document to give minimal rights for deploying an Elastic Beanstalk application.

Where:

  • REGION: AWS region.
  • ACCOUNT_ID: AWS account ID.
  • APPLICATION_NAME: Desired target Elastic Beanstalk application name(space).
  • IAM_INSTANCE_PROFILE_ROLE: The instance profile (IAM role) Elastic Beanstalk EC2 instaces will run under.
@mkremins
mkremins / pbcopy.js
Created April 17, 2014 21:41
node.js: put text into OS X clipboard
function pbcopy(data) {
var proc = require('child_process').spawn('pbcopy');
proc.stdin.write(data);
proc.stdin.end();
}
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: