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
| # eve-linux configurations - not a script, but cmds | |
| # bluetooth | |
| hcitool scan | |
| var=DEVICE | |
| # as root |
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
| # # # REGEX # # # | |
| # The ? matches zero or one of the preceding group. | |
| # The * matches zero or more of the preceding group. | |
| # The + matches one or more of the preceding group. | |
| # The {n} matches exactly n of the preceding group. | |
| # The {n,} matches n or more of the preceding group. | |
| # The {,m} matches 0 to m of the preceding group. | |
| # The {n,m} matches at least n and at most m of the preceding group. | |
| # {n,m}? or *? or +? performs a non-greedy match of the preceding group. |
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
| // zip object of arrays: { [],[], ... } -> [ arr1[0] + arr2[0] ], [ arr1[1], arr2[1], ... ] | |
| const zip = (arrays) => { | |
| return arrays[0].map(function(_,i){ | |
| return arrays.map(function(array){return array[i]}) | |
| }) | |
| } | |
| // e.g. | |
| // stateArray = Object.values(this.context.state).map(i => stateArray.concat(i)) | |
| // stateArray = this.zip(stateArray) |
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
| //convert string to url slug without affecting global variable | |
| function urlSlug(title) { | |
| return title.toLowerCase().trim().split(/\s+/).join("-") | |
| } | |
| //TO-DO: port this function into small application that generates url slugs |
NewerOlder