This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public bool MatchesPattern(string pattern, string text) | |
| { | |
| pattern = pattern.Replace("%", @".+"); | |
| pattern = pattern.Replace("_", @"."); | |
| Regex regex = new Regex(pattern); | |
| if (regex.IsMatch(text)) | |
| { | |
| return true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function fomatPattern(value, pattern){ | |
| if (value){ | |
| var characters = pattern.replace(/#/g, ""); | |
| value = value.replace(new RegExp("["+characters+"]", 'gi'), ""); | |
| if (value){ | |
| return replace(value, pattern); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function formatPattern(value, pattern) { | |
| if (value){ | |
| var characters = pattern.replace(getWildcardRegex(), ""); // removes all wild cards | |
| value = value.replace(new RegExp("["+characters+"]", 'gi'), ""); // removes all non wildcard characters in pattern | |
| if (value){ | |
| return replace(value, pattern); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function observifyArray(arr){ | |
| for(var i = 0; i < ko.unwrap(arr).length; i ++){ | |
| ko.unwrap(arr)[i] = observify(ko.unwrap(arr)[i]); | |
| } | |
| if (ko.isObservable(arr) && 'push' in arr){ | |
| return arr; | |
| } else { | |
| return ko.observableArray(arr); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ko.bindingHandlers.holdClick = { | |
| init: function (element, valueAccessor, allBindings, viewModel, bindingContext) { | |
| var timeoutId = 0; | |
| var option = valueAccessor() || {}; | |
| $(element).mousedown(function () { | |
| timeoutId = setTimeout(option, 1000); | |
| }).bind('mouseup mouseleave', function () { | |
| clearTimeout(timeoutId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function validDate(date){ | |
| var re = /(.{2})\/(.{2})\/((.{4})|(.{2}))/; | |
| if (date.search(re) == -1){ | |
| return false; | |
| } | |
| var dt = date.split("/"); | |
| // month must be less than 13, greater than 0 | |
| var month = dt[0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # remove old node from raspberry pi | |
| sudo apt-get remove nodered -y | |
| sudo apt-get remove nodejs nodejs-legacy -y | |
| sudo apt-get remove npm -y # if you installed npm | |
| # update node (with n) | |
| sudo npm cache clean -f | |
| sudo npm install -g n | |
| sudo n stable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| backgroundColor: '#1E2127', | |
| foregroundColor: '#ABB2BF', | |
| colors: { | |
| black: '#1E2127', | |
| red: '#E06C75', | |
| green: '#98C379', | |
| yellow: '#D19A66', | |
| blue: '#61AFEF', | |
| magenta: '#C678DD', | |
| cyan: '#56B6C2', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "last": "1.0.1", | |
| "source": "pth" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Future versions of Hyper may add additional config options, | |
| // which will not automatically be merged into this file. | |
| // See https://hyper.is#cfg for all currently supported options. | |
| module.exports = { | |
| config: { | |
| // choose either `'stable'` for receiving highly polished, | |
| // or `'canary'` for less polished but more frequent updates | |
| updateChannel: 'stable', | |
OlderNewer