Skip to content

Instantly share code, notes, and snippets.

View 0smr's full-sized avatar
🔪
Who is there?

SMR 0smr

🔪
Who is there?
View GitHub Profile
@0smr
0smr / README.md
Last active January 4, 2024 05:11
Sphere of particles fragment shader using raymarching

Sphere of particles

A sphere of particles in the fragment shader using raymarching.

Warning

The sphere is not rendered correctly, and there are glitches in the rendred result. Any suggestions to get rid of those glitches are welcome.

Preview

@0smr
0smr / README.md
Last active May 9, 2023 19:51
C++/Qt implementation of the SVG arc to cubic curve converter

A C++/Qt implementation of the SVG arc to cubic curve converter, based on the svgpath repository.

Usage

// A 10 10 0 0 0 14 0
auto curves = arcToCubic({0,0}, {10, 0}, {10, 10}, 0, 0, 0);
for(auto curve: curves) {
    qDebug() << curve.c1 << ' '
             << curve.c2 << ' '
 &lt;&lt; curve.to;
@0smr
0smr / Dial.qml
Created August 29, 2022 21:18
Custom QML Dial
import QtQuick 2.15
import QtQuick.Templates 2.15 as T
import QtQuick.Shapes 1.15
import QtGraphicalEffects 1.15
T.Dial {
id: control
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
@0smr
0smr / README.md
Created February 28, 2022 05:59
simple HTML tag input

Tag input

simple tag input.

usage

  1. Add CSS and JS files. <link href = "simple-tag-input.css" rel = "stylesheet"> <script src = "simple-tag-input.js"></script>
  2. Simply put <input value="tag1,tag2,tag3" class="c1 c2 cn" placeholder="Enter tags." taged>.
  3. Enjoy.
@0smr
0smr / ProgressCircle.qml
Created May 20, 2021 22:54
qml circular progress bar with gradient
import QtQuick 2.15
import QtGraphicalEffects 1.0 as QGE
import QtQuick.Shapes 1.15 as QQS
Item {
id: control
implicitHeight: 150
implicitWidth: 150
@0smr
0smr / CustomSlider.qml
Last active April 1, 2025 00:54
a custom QML slider
import QtQuick 2.15
import QtQuick.Controls 2.15
Slider {
id: control
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitHandleWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitHandleHeight + topPadding + bottomPadding)
@0smr
0smr / utf8_file_notations_remover.cpp
Last active June 17, 2022 13:17
read utf-8 file and replace all it's notations with spaces and write content to new file. (file include Persian text)
#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>
#include <codecvt>
#include <string>
#include <locale>
int main()
{