Skip to content

Instantly share code, notes, and snippets.

View NXTaar's full-sized avatar

Valeriy Sagatovskiy NXTaar

View GitHub Profile
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\NXTaar\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'i',
1 verbose cli 'node-sass' ]
2 info using npm@3.3.7
3 info using node@v5.0.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
{
"Status": "ok",
"StatusMessage": "",
"Data": {
"Data": [
{
"Name": "\u041e\u043f\u043b\u0430\u0442\u0430\/\u043f\u0435\u0440\u0435\u0432\u043e\u0434",
"Alias": "PaymentType",
"Type": "multi_listbox",
"Fields": null,
@NXTaar
NXTaar / Simple HTML template generator
Last active November 13, 2015 02:26
Can generate HTML from the string with variables as ${variableName}. The value for that variable should be in data[variableName] The properties of the [data] could be generated recursively with this function
function generateHTML(data, template) {
String.prototype.multiReplace = function (hash) {
var str = this, key;
for ( key in hash ) {
str = str.replace( new RegExp( key, 'g' ), hash[ key ] );
}
return str;
};
var result = "";
var hash = {};
@NXTaar
NXTaar / sizeChange.js
Last active November 9, 2015 00:22
This snippet is allowing to trigger some functions when browser window size changes (you know, like CSS media queries, changes only when it passes through milestone)
// Created by Valeriy Sagatovskiy
// Create the new instance of changeWithSize with parameters :
// - unit: milestone in pixels causing callbacks, f.e. "1024"
// - dimension: which dimension is watched for changes - "width" or "height"
// - b_callback: will be called if dimension changes from big to small
// - a_callback: will be called if dimension changes from small to big
// If you pass only one callback, it will be called in both directions
// If you don't want any actions on the certain direction, just pass 'null' instead of callback