Skip to content

Instantly share code, notes, and snippets.

View SerKnight's full-sized avatar
🏄‍♂️

Christopher Knight SerKnight

🏄‍♂️
View GitHub Profile
@SerKnight
SerKnight / gist:f8f12d69b8dfbbded9b7966ea3d03c31
Created December 9, 2023 10:49
macOS OpenAdaptAI install script - debug log
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/OpenAdaptAI/OpenAdapt/HEAD/install/install_openadapt.sh)"
+ pythonCmd=python3.10
+ pythonVerStr='Python 3.10*'
+ pythonInstallerLoc=https://www.python.org/ftp/python/3.10.11/python-3.10.11-macos11.pkg
+ BRANCH=main
+ REPO=OpenAdaptAI/OpenAdapt.git
+ REPO_URL=https://github.com/OpenAdaptAI/OpenAdapt.git
+ CheckCMDExists brew
+ command=brew
XeroConfiguration xconfig = new XeroConfiguration();
xconfig.ClientId = "yourClientId";
xconfig.ClientSecret = "yourClientSecret";
xconfig.CallbackUri = new Uri("https://localhost:5001") //default for standard webapi template
xconfig.Scope = "openid profile email files accounting.transactions accounting.contacts offline_access";
var client = new XeroClient(xconfig);
//before getting the access token please check that the state matches
@SerKnight
SerKnight / data.json
Last active December 16, 2020 18:35
public xero sdk data
{
"XeroAPI/xero-ruby": {
"commits": 149,
"open_issues_count": 15,
"closed_issues_count": 86,
"open_pulls_count": 2,
"closed_pulls_count": 34,
"pull_requests_comments": 2,
"collaborators_count": 42,
"release_count": 21,
{
"Id": "7cd21606-cf25-4dcf-93da-3cfdf4d7200d",
"Status": "OK",
"ProviderName": "Testing21-05-2020",
"DateTimeUTC": "\/Date(1603989615288)\/",
"CreditNotes": [
{
"CreditNoteID": "a459f738-4e7a-49d7-b234-7b7caac6b96c",
"CreditNoteNumber": "",
"Payments": [],
@SerKnight
SerKnight / json
Created October 29, 2020 15:02
POST-credit-note.json
{
"Type": "ACCPAYCREDIT",
"Contact": {
"ContactID": "eaa28f49-6028-4b6e-bb12-d8f6278073fc"
},
"Date": "2009-03-29",
"LineAmountTypes": "Exclusive",
"LineItems": [
{
"Description": "MacBook - White",
@SerKnight
SerKnight / gist:b95d5b227818534ae7dad5abf089ae20
Created October 28, 2020 17:17
POST MJ tracking category
GET https://api.xero.com/api.xro/2.0/TrackingCategories
{
"Id": "52320140-3aaa-4106-b9fc-087c9feec702",
"Status": "OK",
"ProviderName": "Insomnia Client",
"DateTimeUTC": "\/Date(1603904047088)\/",
"TrackingCategories": [
{
"Name": "Regions",
{
"Contacts": [{
"ContactNumber": "ID001",
"Name": "ABC Limited",
"FirstName": "John",
"LastName": "Smith",
"EmailAddress": "[email protected]",
"Addresses": [
{
"AddressType": "STREET",
@SerKnight
SerKnight / nested.cs
Created October 27, 2020 16:41
example
var contact = new Contact();
contact.Name = Name;
var line = new LineItem() {
Description = LineDescription,
Quantity = float.Parse(LineQuantity),
UnitAmount = float.Parse(LineUnitAmount),
AccountCode = LineAccountCode
};
@SerKnight
SerKnight / summarizeErrors=false.json
Created August 5, 2020 17:57
XeroAPI Batch payments & summarizeErrors
POST https://api.xero.com/api.xro/2.0/Payments?summarizeErrors=false
{
"Payments": [
{
"Invoice": { "InvoiceID": "e081f93b-bdde-417b-b785-2b453c9b3ed3" },
"Account": { "AccountID": "3d09fd49-434d-4c18-a57b-831663ab70d2" },
"Date": "2020-08-05",
"Amount": 234303.00
},
{
@SerKnight
SerKnight / token-migration.rb
Last active June 5, 2020 19:52
Token Migration
require 'uri'
require 'json'
require 'net/http'
uri = URI.parse(ENDPOINT)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
headers = {'Content-Type' =>'application/json', 'Authorization': authorization_header}
request = Net::HTTP::Post.new(uri.request_uri, headers)