Skip to content

Instantly share code, notes, and snippets.

View anytizer's full-sized avatar

Bimal Poudel anytizer

View GitHub Profile
@anytizer
anytizer / phpunit.xml
Created May 29, 2024 21:40
phphunit.xml minimum settings
<phpunit bootstrap="bootstrap.php" colors="true">
<testsuites>
<testsuite name="unit">
<directory suffix="Test.php">cases</directory>
</testsuite>
</testsuites>
</phpunit>
@anytizer
anytizer / lower.md
Created May 29, 2024 18:40
Lower cased API Endpoints in Program.cs

Lower cased API Endpoints in Program.cs

builder.Services.AddRouting(options => options.LowercaseUrls = true);
@anytizer
anytizer / sqlite3.cpp
Last active May 15, 2024 17:51 — forked from lotfio/sqlite3.cpp
c++ sqlite3 create table and insert example
// From: https://gist.github.com/lotfio/cfbf857bc96a0487b53ed4877658a97b
// Fork: https://gist.github.com/anytizer/44bdc76947b302f22c5c1b67a83d2627
/**
* Minor Improvements:
* Sqlite => DatabaseManager.
* One lined insert statements.
* Embedded SQLite3 source code from amalgamation.
* Access pointer with "this".
* OS/compiler specific full path to the database name.
@anytizer
anytizer / routes-scanner.py
Last active November 12, 2023 17:47
Routes scanner for Angular
import glob
import mariadb
import sys
# Semi automated - routing file generator for Angular
#
# Usage:
# pythoh routes-scanner.py > app-routing.module.ts
fourzerofour_handler = "front/front-pagenotfound"
@anytizer
anytizer / SamplesScanner.h
Created June 12, 2023 23:20
SamplesScanner
#pragma once
/**
* Purpose: Deep scan directories for a search pattern in known file extensions.
*
* Usage:
*
* SamplesScanner sc = SamplesScanner();
* QString path = "D:\\lmms\\build\\Debug\\data\\samples";
* QString pattern = "*.ds";
@anytizer
anytizer / api.service.ts.md
Last active December 1, 2023 07:23
Making an API Client Consumer Website in Angular

api.service.ts

import { Injectable } from '@angular/core';
import { CookieService } from 'ngx-cookie-service';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs';
import { IDValueDTO } from './dtos';

@Injectable({
@anytizer
anytizer / Cross Compiling LMMS for Windows on Ubuntu.md
Last active May 4, 2024 05:49
Compiling 64bit LMMS under Windows with Visual Studio

Installing with msys

sudo apt install pacman
pacman --needed -S bash pacman pacman-mirrors msys2-runtime

mkdir build
cd build
../cmake/build_win64.sh
import { ActivatedRoute } from '@angular/router';
constructor(private activatedRoute: ActivatedRoute) {}
ngOnInit(){
const id = this.activatedRoute.snapshot.paramMap.get('id');
}
@anytizer
anytizer / routes.ts
Last active November 7, 2022 00:26
Angular Routes with path match and default match
const routes: Routes = [
{path: '', redirectTo: "home", pathMatch:"full"},
{path: 'home', component: HomeComponent, title: ''},
{path: 'dashboard', component: DashboardComponent, title: ''},
{path: 'login', component: LoginComponent, title: ''},
{path: 'logout', component: LogoutComponent, title: ''},
{path: '**', component: PagenotfoundComponent, title: ''},
];
@anytizer
anytizer / ConfigurationsController.cs
Last active March 20, 2022 20:06
Angular CORS enabled web api server in C# .net 6
using dtos;
using Microsoft.AspNetCore.Mvc;
namespace web.api
{
[Route("api/[controller]")]
[ApiController]
public class ConfigurationsController : ControllerBase
{
[HttpGet]