Skip to content

Instantly share code, notes, and snippets.

View anytizer's full-sized avatar

Bimal Poudel anytizer

View GitHub Profile
@anytizer
anytizer / SamplesScanner.cpp
Created August 15, 2026 01:02
Samples Scanner (.wav) for Qt/LMMS - work in progress.
#include <QApplication>
#include <QTableWidget>
#include <QTableWidgetItem>
#include <QFile>
#include <QDataStream>
#include <QFileInfo>
#include <QDir>
#include <QVBoxLayout>
#include <QWidget>
#include <QList>
@anytizer
anytizer / harvest.py
Created August 6, 2026 07:09
Python Script to create .mmp from .mmpz file (LMMS)
```python
import zlib
input_file = "input.mmpz"
output_file = "output.mmp"
with open(input_file, "rb") as f_in:
f_in.seek(4)
data = f_in.read()
@anytizer
anytizer / apiservice.ts
Last active June 17, 2026 23:15
Looping through HTTP called data in Angular
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
enum Snippets {
skills = "skills-names",
workers = "workers-list",
workers_by_skill = "workers-list-by-skill",
}
@anytizer
anytizer / cover.bat
Created May 21, 2026 04:51
Embed a cover art image to a .mp3 file using ffmpeg
@echo off
setlocal enabledelayedexpansion
REM :: Create an output directory so we don't overwrite original files
mkdir "output" 2>nul
:: Loop through all .mp3 files in the current directory
for %%F in (*.mp3) do (
set "filename=%%~nF"
@anytizer
anytizer / splitter-unicode.php
Last active April 28, 2026 16:24
AI generated Nepali syllables splitter
<?php
function isDevanagariConsonant($char)
{
$code = uniord($char);
return ($code >= 0x0915 && $code <= 0x0939); // क - ह
}
function isVowelSign($char)
{
@anytizer
anytizer / piano-key-names.cpp
Last active July 23, 2026 19:14
LMMS Note Names
// static std::array<QString, 12> s_noteStrings {
// "C", "C\u266F / D\u266D", "D", "D\u266F / E\u266D", "E", "F", "F\u266F / G\u266D",
// "G", "G\u266F / A\u266D", "A", "A\u266F / B\u266D", "B"
// };
static std::array<QString, 12> s_noteStrings {
"सा", "रे॒", "रे", "ग॒", "ग", "म", "म॑",
"प", "ध॒", "ध", "नि॒", "नि"
};
@anytizer
anytizer / resources-in-qt-app.cpp
Created January 4, 2026 22:55
List of resources embedded in a Qt application
// List of resources embedded in a Qt application
QDirIterator it(":", QDirIterator::Subdirectories);
while (it.hasNext())
{
QString dir = it.next();
qDebug() << dir;
// /icons/.
// /icons/logo.svg
// ...
@anytizer
anytizer / cursor-update.cpp
Created January 3, 2026 23:37
Update cursor while resizing...
// Determine the horizontal position
bool left = x <= MARGIN;
bool right = x >= w - MARGIN;
// Determine the vertical position
bool top = y <= MARGIN;
bool bottom = y >= h - MARGIN;
if (left && top) {
setCursor(Qt::SizeFDiagCursor); // Top-Left corner ( \ )
@anytizer
anytizer / randomize-patterns.cpp
Last active December 26, 2025 03:47
Various patches for LMMS like randomize() patterns, colors, etc.
// work in progress | help required
void PatternEditor::randomizePatterns()
{
TrackContainer::TrackList tl = model()->tracks();
// @todo Skip counting unsunpported tracks
int tracks = tl.size();
if(tracks>24)
{
@anytizer
anytizer / \app\Providers\AppServiceProvider.php
Created November 21, 2025 06:49
Laravel bootsrap attach a secondary sqlite database
```
use Illuminate\Support\Facades\DB;
...
public function boot(): void
{
DB::statement("ATTACH DATABASE '/path/database2.db' AS db2;");
}
```