Skip to content

Instantly share code, notes, and snippets.

@wk-j
wk-j / kiota.md
Created August 1, 2023 09:08
Kiota

Microsoft Kiota is a tool that generates API clients for HTTP REST APIs described by OpenAPI. It supports a wide range of languages and leverages the full capabilities of OpenAPI descriptions.

Here are some of its features:

  • Generate API clients for HTTP REST APIs described by OpenAPI.
  • Support for a wide range of languages.
  • Leverage the full capabilities of OpenAPI descriptions.
  • Generate only the source code necessary.
  • Minimize external dependencies.
@wk-j
wk-j / kill.sh
Created March 17, 2023 08:58
Kill process using port 7022 in macOS
lsof -i :7022 | grep LISTEN | awk '{print $2}' | xargs kill -9
@wk-j
wk-j / Request.http
Last active November 1, 2022 09:30
Change alfresco search items
POST http://localhost:8080/alfresco/api/-default-/public/search/versions/1/search
Content-Type: application/json
Authorization: Basic admin admin
Accept: application/json
{
"query": {
"query": "TYPE:'content' AND (PATH:'/app:company_home/st:sites/cm:services-sales-support-management//*' OR PATH:'/app:company_home/st:sites/cm:business-development//*' OR PATH:'/app:company_home/st:sites/cm:bancassurance//*')",
"language": "afts"
},
@wk-j
wk-j / Dockerfile
Last active August 26, 2022 13:18
System.Globalization.CultureNotFoundException: Only the invariant culture is supported in globalization-invariant mode
# Runtime image
FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine
# Fixed: Only the invariant culture is supported in globalization-invariant mode
RUN apk add --no-cache icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
# Set timezone
RUN apk add --no-cache tzdata
ENV TZ='Asia/Bangkok'
@wk-j
wk-j / dotnetlayout.md
Created July 12, 2022 09:16 — forked from davidfowl/dotnetlayout.md
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@wk-j
wk-j / TLMBot.js
Created April 12, 2021 13:35 — forked from earthchie/TLMBot.js
class TLMBot {
constructor(minWaitTime = 5000, maxWaitTime = 15000) {
this.minWaitTime = minWaitTime;
this.maxWaitTime = maxWaitTime;
this.isMining = false;
this.isBotRunning = false;
this.startedAt = 0;
this.initialBalance = 0;
this.accumulate = 0;
@wk-j
wk-j / CreateTable.txt
Last active January 30, 2021 10:06
Create table
CREATE TABLE `alf_child_assoc` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`version` bigint(20) NOT NULL,
`parent_node_id` bigint(20) NOT NULL,
`type_qname_id` bigint(20) NOT NULL,
`child_node_name_crc` bigint(20) NOT NULL,
`child_node_name` varchar(50) NOT NULL,
`child_node_id` bigint(20) NOT NULL,
`qname_ns_id` bigint(20) NOT NULL,
`qname_localname` varchar(255) NOT NULL,
@wk-j
wk-j / CreateTable.fsx
Last active January 30, 2021 06:39
Create table
#r "nuget: RepoDb.MySQL"
#load "ConnectionString.fsx"
open MySql.Data.MySqlClient
open RepoDb
open RepoDb.Attributes
open System.Linq
type Create = {
Table: string
@wk-j
wk-j / multipart-formdata.http
Last active January 20, 2021 11:09
VS Code Rest Client - multipart/form-data example
POST http://192.168.0.19:8080/xyz/service/api/uploadFile?alf_ticket=TICKET_04bb4fc44be78e3082a675e6d9f9d278ecd195eb
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="Field1"
Field1-Value
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="Field2"
@wk-j
wk-j / T.cs
Created January 19, 2021 06:34
using System;
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
namespace Request
{
public class Settings
{
public RequestApi[] RequestApi { set; get; }