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
f=v=>{[...v].map(c=>eval([...c].map(p=>p|0).join`+`));return!(v[0]^v[1]) |
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
{ | |
"name":"rand-url-create", | |
"version":"0.0.1", | |
"description":"Random URL Generator URI encoded param", | |
"license":"Creative Commons Zero v1.0 Universal", | |
"author":"C. Dek. chrdek - github" | |
} |
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
//Extract key-values from string in the format of 'k1=v1&k2=v2&k3=v3' (with uri decoding) | |
String.prototype.ToKvps = function(){ | |
var qd={}; | |
this.split`&`.forEach(item => {let [k,v] = item.split`=`; v = v && decodeURIComponent(v); | |
(qd[k] = qd[k] || []).push(v)}); | |
return qd; | |
} | |
//Example: JSON.stringify("fd=44&ds=32&dks=1314%41&sd=39%209&ds=dsl%20ds".ToKvps()); | |
//Output: "{"fd":["44"],"ds":["32","dsl ds"],"dks":["1314A"],"sd":["39 9"]}" |
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
// Input string format: 'fd=44&ds=32&dks=1314' is converted to output array of objects.. | |
String.prototype.ToKVPObj= function(){ | |
return(this+"&").match(/[a-zA-Z]+(=){1}[a-zA-Z0-9]+(&){1}/gi) | |
.map(c=> {var a=[]; var dObj={}; | |
a = c.replace("&","").split("="); | |
dObj[a[0]]=a[1]; | |
return dObj; | |
}); | |
} |
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
<# | |
.Synopsis | |
Original file taken from https://gallery.technet.microsoft.com/scriptcenter/Powershell-FileSystemWatche-dfd7084b | |
Adapted for monitoring visual studio debug crashes with delimited log files creation/modification | |
.Description | |
This script monitors only log files created or modified on a specified directory | |
and creates the corresponding csv output per changed file content | |
NOTE: Default target dir is C:\%APPDATA%\ |
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
<# | |
.Synopsis | |
This function is used for generating csv output from a log file that contains | |
visual studio debug info, and cleans text content for uploading to a log analysis service | |
.Description | |
The script might need to be run on-demand or via a scheduled task per modified folder or changed file event | |
It exports debug info and creates the appropriate csv formatted output files | |
NOTE: Generated file with size larger than 64K is transferred to loggly service, |
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
#!/bin/bash | |
################################################################################################## | |
# | |
# Display stash details with colorized output. | |
# | |
# Author: Chr. Dek. |
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
//String reverse function with for loop | |
String.prototype.reverseString = function(){ | |
s=[...this]; r=[]; | |
for(i=0;;){if(i!=s.length){r.push(s.pop())}else{break;}} | |
return r.join(''); | |
} | |
//Sample usage: "thisisreversed12".reverseString(); | |
//Output from usage | |
//"21desreversisiht" |
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
//Example 1 element remove.. | |
Array.prototype.removeAt = function(i) { | |
delete this[i]; return this.filter(e=>e); | |
} |
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
var a = [0,1,2,3,4], | |
b = [5,6,7,8,9]; | |
Array.prototype.zip = function (arr) { | |
return this.map(function (e, i) { | |
return [e, arr[i]]; | |
}) | |
}; | |
//Usage: a.zip(b) = [[0,5], [1,6], [2,7], [3,8], [4,9]] |