Skip to content

Instantly share code, notes, and snippets.

View fridezlucas's full-sized avatar
🔥

Lucas Fridez fridezlucas

🔥
  • Artionet Web Agency
  • Suisse
View GitHub Profile
@fridezlucas
fridezlucas / Startup.cs
Last active November 2, 2021 20:31
Medium TypeScript GET+ POST RESTful client - Startup.cs
// All using...
namespace My.Awesome.Namespace.Api
{
public class Startup
{
// ...
public void ConfigureServices(IServiceCollection services)
@fridezlucas
fridezlucas / ApiClient.ts
Last active November 2, 2021 20:32
Medium TypeScript GET+ POST RESTful client - ApiClient
import Axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from "axios";
type HttpVerb = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
class ApiClient {
private static singleton: ApiClient;
private readonly instanceAxios: AxiosInstance;
private URL: string = "https://localhost:44300/";
private constructor() {
@fridezlucas
fridezlucas / IApiClient.ts
Last active November 2, 2021 20:16
Medium TypeScript GET+ POST RESTful client - IApiClient
interface ApiClient {
instance(): ApiClient;
get<T>(url: string): Promise<T>;
post<T>(url: string, body: any): Promise<T>;
put<T>(url: string, body: any): Promise<T>;
patch<T>(url: string, body: any): Promise<T>;
delete<T>(url: string): Promise<T>;
}
@fridezlucas
fridezlucas / WidgetQtRadioButtons.cpp
Last active November 30, 2019 15:07
[Qt RadioButton With Group] Radio Buttons with specified groups #qt
#include "widget.h"
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QButtonGroup>
#include <QRadioButton>
Widget::Widget(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *lytMain = new QHBoxLayout(this);