This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const { | |
Model | |
} = require('sequelize'); | |
module.exports = (sequelize, DataTypes) => { | |
class Service extends Model { | |
/** | |
* Helper method for defining associations. | |
* This method is not a part of Sequelize lifecycle. | |
* The `models/index` file will call this method automatically. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const { | |
Model | |
} = require('sequelize'); | |
module.exports = (sequelize, DataTypes) => { | |
class Service extends Model { | |
/** | |
* Helper method for defining associations. | |
* This method is not a part of Sequelize lifecycle. | |
* The `models/index` file will call this method automatically. |
my mail is rj (AT) rileyjames.co
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"userAgent" : "Riley Tierion Example", | |
"consumerKey": "FUTDJTYEWGSKVVCKKWQFJTDJSURDEY", | |
"consumerSecret": "DHSURTYDPDXOKAZ6DUIQRGTJDTUYFD", | |
"privateKeyPath": "./privatekey.pem", | |
"webhookKey": "ByxdfkFMZd0+wLsd1UV/yF/+oMzhhTD5PiETFidppgY7x6v7woYwutDiyijQKXg2m2WFJDTSlaykJOh910xWtg==" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
require 'base64' | |
require 'openssl' | |
post '/webhook' do | |
payload = request.body.read | |
key = "WEBHOOKS_KEY" | |
signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), key, payload)).strip() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// AWS s3 | |
const aws = require('aws-sdk'); | |
aws.config.loadFromPath('./aws.json'); | |
aws.config.update({region:'us-east-1'}); | |
const s3 = new aws.S3(); | |
// Xero client | |
const xero = require('xero-node') | |
const fs = require('fs') | |
const config = require('./xero.json') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "net/http" | |
require "uri" | |
require "json" | |
uri = URI.parse("https://www.howsmyssl.com/a/check") | |
http = Net::HTTP.new(uri.host, uri.port) | |
http.use_ssl = true | |
resp = JSON.parse(http.request(Net::HTTP::Get.new(uri.request_uri)).body) | |
puts JSON.pretty_generate(resp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const express = require('express') | |
const bodyParser = require('body-parser') | |
const crypto = require('crypto') | |
// Replace with your Xero Webhook Key | |
const xero_webhook_key = 'XERO_WEBHOOK_KEY' | |
// Create a new instance of express |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const hapi = require('hapi') | |
const crypto = require('crypto') | |
// Set the server to launch on localhost:3000 | |
const server = hapi.server({ host: 'localhost', port: 3000 }) | |
// Replace with your Xero Webhook Key | |
const xero_webhook_key = 'XERO_WEBHOOK_KEY' |
NewerOlder