Skip to content

Instantly share code, notes, and snippets.

View nicemaker's full-sized avatar

Bjorn Newkirk Grambow nicemaker

  • Crete, Greece
View GitHub Profile
@nicemaker
nicemaker / Payment session
Created June 18, 2020 13:58
Mock requests
curl -XPOST -H "Content-type: application/json" -d '{"checkout":{"cart":{"items":[{"variantId":8033147715626,"quantity":10}]},"shippingAddress":{"firstName":"Bjorn","lastName":"Grambow","street":"Street 1","postcode":"51647","city":"Gummersbach","country":"DE"},"customerId":2984640380970},"listParams":{"returnUrl":"example.com","cancelUrl":"example.com"}}"' 'https://cha2ypn5y6.execute-api.eu-central-1.amazonaws.com/staging'
@nicemaker
nicemaker / debounce.js
Last active May 6, 2020 11:52
Debounce
export default function(f,ms){
let t;
return (...args)=>{
if( t ){ t = clearTimeout( t ); }
t = setTimeout( (args)=>{
clearTimeout( t );
f.apply( this,args );
},ms );
};
}