Skip to content

Instantly share code, notes, and snippets.

@satsalou
satsalou / example.cs
Created February 29, 2024 20:17
Remove Task from Dictionary after cancel
[HttpPost]
[Route("api/longrunning/stop")]
public IHttpActionResult StopLongRunningProcess(int taskId)
{
// Check if the task ID exists
if (longRunningTasks.ContainsKey(taskId))
{
// Get the CancellationTokenSource for the task
var cancellationTokenSource = cancellationTokenSources[taskId];
@satsalou
satsalou / example.cs
Created February 29, 2024 20:16
Keep Tasks in Dictionary and use ID to cancel them
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Http;
namespace YourNamespace
{
public class LongRunningController : ApiController
{
@satsalou
satsalou / example.cs
Created February 29, 2024 20:13
Custom ID to Task
using System;
using System.Threading.Tasks;
class CustomTask
{
public int CustomId { get; private set; }
public Task Task { get; private set; }
public CustomTask(int customId, Task task)
{
@satsalou
satsalou / new order
Created May 25, 2021 07:24
Coffee Monster app - Body of new order API request
{
"cart":[
{
"options":{
"Size":{
"id":"5e256b932f075",
"name":"Short",
"price":"28.99",
"is_default":true,
"no_stock":false
@satsalou
satsalou / config.xml
Created October 9, 2020 12:17
Coffee monster - config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.dawpro.moco" version="2.3.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Coffee Monster</name>
<description>Don’t queue for your brew. On-the-go order and pickup service for your pick-me-up. Convenient, smarter, faster access to your daily coffee fix</description>
<author email="david@dawpro.solutions" href="https://dawpro.solutions/">Dawpro Solutions</author>
<content src="index.html" />
<access origin="*" />
<access launch-external="yes" origin="whatsapp:*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
@satsalou
satsalou / ios
Created October 9, 2020 12:05
Coffee Monster - iOS error logs
2020-09-09 16:32:17.803476+0300 Coffee Monster[67621:10009888] <Warning>: Please set a value for FacebookAutoLogAppEventsEnabled. Set the flag to TRUE if you want to collect app install, app launch and in-app purchase events automatically. To request user consent before collecting data, set the flag value to FALSE, then change to TRUE once user consent is received. Learn more: https://developers.facebook.com/docs/app-events/getting-started-app-events-ios#disable-auto-events.
2020-09-09 16:32:17.804524+0300 Coffee Monster[67621:10009888] <Warning>: You haven't set a value for FacebookAdvertiserIDCollectionEnabled. Set the flag to TRUE if you want to collect Advertiser ID for better advertising and analytics results. To request user consent before collecting data, set the flag value to FALSE, then change to TRUE once user consent is received. Learn more: https://developers.facebook.com/docs/app-events/getting-started-app-events-ios#disable-auto-events.
2020-09-09 16:32:18.058675+0300 Coffee Monster[67621:100098
@satsalou
satsalou / avatax-create-transaction-response
Last active August 7, 2020 19:58
Avatax: Create Transaction Response
{ id: 0,
code: 'acd0c79a-715c-4595-b310-9b0d293a26eb',
companyId: 193327,
date: '2020-08-07',
paymentDate: '2020-08-07',
status: 'Temporary',
type: 'SalesOrder',
currencyCode: 'USD',
customerVendorCode: 'Sofia Atsalou',
customerCode: 'Sofia Atsalou',
@satsalou
satsalou / avatax-create-trasaction-payload
Created August 7, 2020 19:55
Avatax: Create Transaction Payload
{ type: 'SalesOrder',
companyCode: 'PHYSICIANSEXCLUSIVELLC',
date: '2020-08-07T19:46:59.989Z',
customerCode: 'Sofia Atsalou',
purchaseOrderNo: 1596829619989,
addresses:
{ shipTo:
{ line1: '101 E Town Place, Suite 210',
country: 'US',
region: 'FL',
@satsalou
satsalou / paid-order.json
Created February 2, 2020 20:22
Paid WooCommerce Order with total after discounts and tax included for each line item
{
"total": "239.2",
"prices_include_tax": true,
"customer_id": 15035,
"billing": {
"first_name": "Sofia",
"last_name": "Atsalou",
"address_1": "101 E Town Place, Suite 210",
"city": "Saint Augustine",
"state": "FL",
@satsalou
satsalou / unpaid-order.json
Last active February 2, 2020 20:21
Unpaid WooCommerce Order with total after discounts and tax included for each line item
{
"total": "239.2",
"prices_include_tax": true,
"customer_id": 15035,
"billing": {
"first_name": "Sofia",
"last_name": "Atsalou",
"address_1": "101 E Town Place, Suite 210",
"city": "Saint Augustine",
"state": "FL",