Skip to content

Instantly share code, notes, and snippets.

---
http_interactions:
- request:
method: post
uri: https://api.helpscout.net/v2/oauth2/token
body:
encoding: UTF-8
string: '{"client_id":"WB5Utt63qEhH8xZLvGKp3IGccL964FoU","client_secret":"ovnIsrCBxUzppvPvhtxKXGw8O5zyL1Gl","grant_type":"client_credentials"}'
headers:
Content-Type:
@thilonel
thilonel / app_store_server_notification_verifier.go
Last active May 14, 2023 18:46
Apple App Store Server Notification JWT Verification
package app_store_server_notification_verifier
import (
"crypto/ecdsa"
"crypto/x509"
"encoding/base64"
"errors"
"io/ioutil"
"github.com/golang-jwt/jwt"
@thilonel
thilonel / main.go
Created January 25, 2022 15:29
Find out which cert was used for JWS siging from x5c header
package main
import (
"crypto/x509"
"encoding/base64"
"errors"
"fmt"
"io/ioutil"
"github.com/golang-jwt/jwt"
@thilonel
thilonel / sanitizing_script.sh
Created September 4, 2019 15:33
sanitize file names for onedrive
#!/bin/bash
#This script will rename files for the given directory. Removing all illegal characters.
#Usage ./Script.sh /directory/to/run
verbose=1
#Set/clear variables
folder=$1
loop=0
loopnum=0
#Rotate Logs
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@thilonel
thilonel / 0_reuse_code.js
Created March 25, 2016 15:02
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@thilonel
thilonel / config.ru
Created March 25, 2016 14:13
restful_api
require 'rack/app'
class App < Rack::App
desc 'get user'
get '/users/:user_id' do
params['user_id']
end
end
@thilonel
thilonel / app.rb
Created March 25, 2016 14:12
simple_website
require 'rack/app'
require 'rack/app/front_end'
class App < Rack::App
extend Rack::App::FrontEnd
helpers do
def method_that_can_be_used_in_template
@thilonel
thilonel / config.ru
Created March 25, 2016 14:11
simple_api
require 'rack/app'
class App < Rack::App
desc 'health check endpoint'
get '/' do
'OK'
end
get '/hello' do
@thilonel
thilonel / config.ru
Last active March 25, 2016 14:10
auth_api
require 'rack/app'
require 'escher'
require 'escher-keypool'
require 'escher/rack_middleware'
Escher::RackMiddleware.config do |c|
c.add_escher_authenticator { Escher::Auth.new(Credential::Scope, Credential::AuthOptions) }
c.add_credential_updater { Escher::Keypool.new.get_key_db }
end