Skip to content

Instantly share code, notes, and snippets.

View stefanak-michal's full-sized avatar

Michal Štefaňák stefanak-michal

View GitHub Profile
@stefanak-michal
stefanak-michal / date.toString.js
Created March 5, 2024 09:54
Override of Date toString function with format support
/**
* Formats the Date object according to the provided format string.
*
* @param {string} [format] Optional format string consisting of one or more of the following letters:
* - `d`: Day of the month (1-31)
* - `dd`: Day of the month, zero-padded (01-31)
* - `m`: Month number (1-12)
* - `mm`: Month number, zero-padded (01-12)
* - `y`: Full year (e.g., 2024)
* - `yy`: Last two digits of the year (00-99)
#!/bin/sh
JSON=$(curl -s https://api.github.com/repos/go-gitea/gitea/releases/latest)
PRERELEASE=$(echo "$JSON" | jq '.prerelease')
if [ "$PRERELEASE" = "true" ]; then
echo "latest is prerelease, exit"
exit 0
fi
/**
* Better confirm.<br>
* It requires jQuery and bootstrap v5.
*
* <pre>
* Use as Promise: betterConfirm('title').then(function)
* Or as jQuery event: .on('action', {
* title: string,
* callback: function,
* confirm: string,
//if you need debug speed to console
var DEBUG_SORT_SPEED = false;
/**
* Ordering tables with table class definition <table class='sort'>, and have defined <thead> with <th> cells
* Column with all integer values, sorted automatic numeric
* Force say to column be a order numeric <th sorttype='int'>
* Or by datetime <th sorttype='date' date-format='d.m.y'> (for more info see fnc generateDateByFormat anotation)
*
* @author Michal Stefanak
@stefanak-michal
stefanak-michal / README.md
Created September 4, 2020 07:28 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@stefanak-michal
stefanak-michal / bezierCurveMoulding.cs
Last active September 15, 2023 00:06
Moulding of n-length Bezier curve (Unity3D C# script)
using UnityEngine;
/// <summary>
/// Moulding of Bezier curve control points
/// author: Michal Stefanak
/// https://ko-fi.com/michalstefanak
///
/// In Unity play mode enable drawing gizmos at the top to render bezier curve
/// </summary>
public class TestMould : MonoBehaviour