Skip to content

Instantly share code, notes, and snippets.

View ggkrustev's full-sized avatar

Georgi Krustev ggkrustev

View GitHub Profile
@ggkrustev
ggkrustev / Mask rules in JSP
Last active August 29, 2015 13:56
A simple test for creating custom mask rules in JSP
<%
Map<String,Object> map = new HashMap<String,Object>();
String rule = "/[+-]/";
map.put("~", new Function(rule));
String rule2 = "function (char) {" +
"return char ==='*';" +
"}";
@ggkrustev
ggkrustev / Mask rules in PHP
Created February 25, 2014 16:31
A simple test for creating custom mask rules in PHP
$rules = array();
$rules["~"] = new \Kendo\JavaScriptFunction('/[+-]/');
$phone_number = new \Kendo\UI\MaskedTextBox('phone_number');
$phone_number->rules($rules);
(function($) {
var kendo = window.kendo;
var globalize = window.Globalize;
function expandNumberFormat(numberFormat) {
numberFormat.groupSizes = numberFormat.groupSize;
numberFormat.percent.groupSizes = numberFormat.percent.groupSize;
numberFormat.currency.groupSizes = numberFormat.currency.groupSize;
}
kendo.culture = function (cultureName) {
@ggkrustev
ggkrustev / position-strategy
Created August 3, 2016 14:45
Popup strategy of Kendo Popup for Angular 2
horizontal:
{
'left', //use 'left' pivot point of the element
'center', //use 'center' pivot point of the element
'right' //use 'right' pivot point of the element
}
vertical:
{
'top', //use 'top' pivot point of the element
@ggkrustev
ggkrustev / collision-strategy
Created August 3, 2016 14:49
Collision strategy of Kendo Popup for Angular 2
collision:
{
'fit', //fits the popup position if it is not fully visible in the view-port
'flip' //flips the popup position if it is not fully visible in the view-port
}
@ggkrustev
ggkrustev / angular-combobox-change-method
Created November 7, 2016 10:10
angular-combobox-change-method
protected change(candidate: any, isCustom: boolean = false): void {
const currentValue: any = Util.getter(this.value, this.valueField);
this.open = false;
if (isCustom) {
this.handleCustomValue(candidate, currentValue);
} else {
this.handleValue(candidate, currentValue);
}
@ggkrustev
ggkrustev / infinite-date-range
Created January 30, 2017 13:11
Research whether to support infinite min/max range
# Should we support infinite date range
## Competitors
### AngularJS Material
They do have virtualized scrolling but does not support infinite min/max date range. When set to null,
the lowest date is still the default one (1880-0-1)
Demo: http://codepen.io/anon/pen/KaZvxo
@ggkrustev
ggkrustev / Changes in input event
Created February 21, 2017 16:57
Detect changes in the input event listening only to the `input` event
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Input - detect changes in the text</title>
</head>
<body>
<input id="dateinput" />
<script>
const startMatchIndex = (origin = "", candidate = "") => {
@ggkrustev
ggkrustev / functional-resources.md
Last active April 10, 2023 22:42
Functional programming resources
@ggkrustev
ggkrustev / package-scripts.md
Last active November 29, 2018 08:51
The minimum common list of scripts every package.json should contain

Scripts in package.json

The absolute minimum of NPM scripts required for a React app to be build by TeamCity.

{
  ...
  scripts: {
    ...
    "build": "XXX: builds a deployable version in dev mode",
 "lint": "XXX: lints the code",