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,
@stefanak-michal
stefanak-michal / tableSorter.js
Last active August 15, 2024 05:56
Removed jQuery as dependency. Refactored.
//if you need debug speed to console
let DEBUG_SORT_SPEED = false;
/**
* Ordering tables with table class definition <table class='sort'>
* Table has to properly structured which means <thead> with <th> cells and <tbody> (sorting supports multiple tbody in one table)
* Column with all integer values, sorted automatic numeric
* Force say column to be integer order <th data-sort-type='int'>
* Or by datetime <th data-sort-type='date'>
* You can also define own date format with attribute data-date-format='YYYY-MM-DD'
@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