Skip to content

Instantly share code, notes, and snippets.

View unglud's full-sized avatar
⛑️
Set your status

Sasha Mat unglud

⛑️
Set your status
View GitHub Profile
@unglud
unglud / machine.js
Created January 11, 2023 11:24
Generated by XState Viz: https://xstate.js.org/viz
var EmailType;
(function (EmailType) {
EmailType["APPLICATION_SUBMISSION"] = "APPLICATION_SUBMISSION";
EmailType["ACCEPT_OFFER_REMINDER_1"] = "ACCEPT_OFFER_REMINDER_1";
EmailType["ACCEPT_OFFER_REMINDER_2"] = "ACCEPT_OFFER_REMINDER_2";
EmailType["ACCEPT_OFFER_REMINDER_3"] = "ACCEPT_OFFER_REMINDER_3";
EmailType["ACCEPT_OFFER_REMINDER_4"] = "ACCEPT_OFFER_REMINDER_4";
EmailType["APPROVAL"] = "APPROVAL";
EmailType["CANCELLATION"] = "CANCELLATION";
EmailType["COMPANY_INFORMATION_REMINDER_1"] = "COMPANY_INFORMATION_REMINDER_1";
@unglud
unglud / connect.js
Created April 14, 2021 09:58
Connect with Scriptable
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-brown; icon-glyph: magic;
function formatDate (date) {
const monthNames = [
'January', 'February', 'March',
'April', 'May', 'June', 'July',
'August', 'September', 'October',
'November', 'December'
];
<?php
declare(strict_types=1);
use Symfony\Component\Filesystem\LockHandler;
/**
* Class Forklift
*
* @package C24Shopping\Core\App\Service
*/
<?php
namespace Core\App\Service\Money;
use Money\Currencies\ISOCurrencies;
use Money\Formatter\DecimalMoneyFormatter;
use Money\Parser\DecimalMoneyParser;
class Money
@unglud
unglud / sklonyator.php
Created February 24, 2016 14:06
Склонение числительных
sklonyator($number, $titles){
$cases = array(2, 0, 1, 1, 1, 2);
return $titles[($number % 100 > 4 && $number % 100 < 20) ? 2 : $cases[min($number % 10, 5)]];
}
@unglud
unglud / gmap_drawer.js
Created January 21, 2016 16:31
Google maps Module. Can add marker, directions and draw path by directions
var ProjectMap = (function () {
"use strict";
var _center = {lat: 50.159573, lng: 71.918242}, // map center on load
_points = [],
_map = null,
_useDirectios = false, // generate directions with google.maps.DirectionsService() or use simple google.maps.Polyline
_cache = [], // cache for google.maps.Geocoder()
_isDraggable = !('ontouchstart' in document.documentElement);
// constructor