Skip to content

Instantly share code, notes, and snippets.

View gmjelle's full-sized avatar
🤠
Coding

Jelle Van de Vliet gmjelle

🤠
Coding
View GitHub Profile
import NodeRSA from "node-rsa";
const keyData = {
consumerId: "CONSUMER_ID",
privateKey: `-----BEGIN RSA PRIVATE KEY-----
MY PRIVATE KEY
-----END RSA PRIVATE KEY-----`,
keyVer: 1,
impactId: "YOUR IMPACT AFFILIATE ID" // not required
},
@gmjelle
gmjelle / aliExpressApi.js
Last active September 7, 2023 19:13
Making an API call to the AliExpress Affiliate API. Explains how to sign the request and create the correct hash.
import crypto from "crypto";
import dayjs from "dayjs";
import utc from "dayjs/plugin/utc";
import timezone from "dayjs/plugin/timezone";
dayjs.extend(utc);
dayjs.extend(timezone);
const API_URL = "http://gw.api.taobao.com/router/rest";
const API_SECRET = "FIND THIS IN THE AE CONSOLE";
@gmjelle
gmjelle / indexAccountsToCloudsearch.js
Created December 20, 2016 15:33 — forked from ryanfitz/indexAccountsToCloudsearch.js
index dynamodb data to cloudsearch using AWS Lambda
var AWS = require('aws-sdk');
exports.handler = function(event, context) {
var cloudsearchdomain = new AWS.CloudSearchDomain({endpoint: 'doc-dev-cinch-accounts-ltmqj5gt5mjb5hg5eyqaf2v5hu.us-east-1.cloudsearch.amazonaws.com'});
var documents = event.Records.map(function(record) {
var data = {id : record.dynamodb.Keys.id.S};
if (record.eventName === 'REMOVE') {
data.type = 'delete'
@gmjelle
gmjelle / indexAccountsToCloudsearch.js
Created December 20, 2016 15:33 — forked from ryanfitz/indexAccountsToCloudsearch.js
index dynamodb data to cloudsearch using AWS Lambda
var AWS = require('aws-sdk');
exports.handler = function(event, context) {
var cloudsearchdomain = new AWS.CloudSearchDomain({endpoint: 'doc-dev-cinch-accounts-ltmqj5gt5mjb5hg5eyqaf2v5hu.us-east-1.cloudsearch.amazonaws.com'});
var documents = event.Records.map(function(record) {
var data = {id : record.dynamodb.Keys.id.S};
if (record.eventName === 'REMOVE') {
data.type = 'delete'
@gmjelle
gmjelle / bol_plaza.py
Last active November 20, 2016 15:22
Bol Plaza API
import time
import requests
import hmac
import hashlib
import base64
SECRET_KEY='XXX'
PUBLIC_KEY='YYY'
code = '123' # I was thinking of using a unique md5 hash for each product, but for this example I'll just use 123
Verifying that +jellevdvliet is my blockchain ID. https://onename.com/jellevdvliet
@gmjelle
gmjelle / DiscogsApi.md
Last active September 20, 2015 16:42 — forked from younes0/DiscogsApi.md
Setting up Discogs PHP API client with OAuth feature

Setting up Discogs PHP API client with OAuth feature

Get these composer packages

"guzzlehttp/guzzle": "4.1.x",
"guzzlehttp/oauth-subscriber": "0.1.x",
"league/oauth1-client": "~1.0",