This file contains 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
//====================================================================================================== | |
// Looks in the current directory for a move directory, cycles all the files moving them to a new or | |
// existing directory with the format yyyy-mm using the file name as a date indicator. When the file | |
// is an MP4 it will be moved to yyyy-mm-VIDS | |
// | |
// Can be batched in a Windows organize.bat using the following: | |
// | |
// node /your/path/to/files/and/organize.js --stack | |
// PAUSE | |
// |
This file contains 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 secretToken = 'SECRET'; | |
var sendTo = '[email protected]'; | |
var org = 'node-forward'; | |
var repo = 'help'; | |
var prefix = '[' + org + '-' + repo + ']'; | |
var rx = new RegExp('\\[(' + org + ')-(' + repo + ')\\][\\s\\S]+\\(#(\\d+)', 'i'); | |
// recieving issue/comments from GitHub | |
function doPost(e) { | |
return toMailingList(e, JSON.parse(e.postData.getDataAsString())); |
This file contains 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 | |
LC_ALL=en_US.UTF-8 | |
# configures/installs common CHIP features (including enabling disabled ones) | |
# run 'sudo chmod +x setup.sh && ./setup.sh' to run the installation | |
clear | |
res= | |
dtc= | |
rboot= | |
uname -a | |
cat << _EOF_ |
This file contains 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.prototype.replace` alternative that supports `async` _replacer_ functions | |
* @private | |
* @ignore | |
* @param {String} str The string to perform a replace on | |
* @param {RegExp} regex The regular expression that the replace will match | |
* @param {Function} replacer An `async` function that operates the same way as the function passed into `String.prototype.replace` | |
*/ | |
async function replace(str, regex, replacer) { | |
const mtchs = []; |
This file contains 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
/** | |
* Contitional directive that evaluates each template literal expression for | |
* [truthiness](https://developer.mozilla.org/en-US/docs/Glossary/Truthy). Each expression that evaluates to a _truthy_ | |
* value will include the string following the expression in the return value. Any string preceding the first expression | |
* will be included in the result. | |
* @example | |
* truthy`${ it.myValue === 123 } | |
* <div> | |
* This will be included in the result when <code>myValue === 123</code> | |
* </div> |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Pixel Editor</title> | |
<style> | |
.row {margin-left: auto;margin-right: auto;margin-bottom: 20px;} .row:after {content: "";display: table;clear: both;} | |
.row .col {float: left;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;padding: 0 0.75rem;text-align: left;} | |
.row .col.s1 {width: 8.33333%;margin-left: 0;} .row .col.s2 {width: 16.66667%;margin-left: 0;} .row .col.s3 {width: 25%;margin-left: 0;} .row .col.s4 {width: 33.33333%;margin-left: 0;} .row .col.s5 {width: 41.66667%;margin-left: 0;} | |
.row .col.s6 {width: 50%;margin-left: 0;} .row .col.s7 {width: 58.33333%;margin-left: 0;} .row .col.s8 {width: 66.66667%;margin-left: 0;} .row .col.s9 {width: 75%;margin-left: 0;} .row .col.s10 {width: 83.33333%;margin-left: 0;} | |
.row .col.s11 {width: 91.66667%;margin-left: 0;} .row .col.s12 {width: 100%;margin-left: 0;} .row .col.offset-s1 {margin-left: 8.33333%;} .row .col.offset-s2 {margin-left: 16.66667%;} .row .col.offset- |
This file contains 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
# Clone the Github repository | |
git clone --mirror https://github.com/<YOUR GITHUB ACCT>/<YOUR GITHUB REPO NAME>.git | |
# Change working directory to the newly created repo dir | |
cd <YOUR REPO NAME>.git | |
# Set the URL to the new repo origin | |
git remote set-url --push origin https://<YOUR BITBUCKET ACCT>@bitbucket.org/<YOUR BITBUCKET USER OR ORG>/<YOUR BITBUCKET REPO NAME> | |
# Push the mirror to the Bitbucket repo (should prompt you for your Bitbucket credentials in popup) | |
git push --mirror |
This file contains 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
const Fs = require('fs'); | |
const Path = require('path'); | |
/** | |
* Generates a set of file paths by recursively traversing the given directory | |
* @param {String} dir The directory to traverse | |
* @param {Boolean} [join] Truthy to use `path.join` vs the _default_ concatination | |
* @yields {String} The next file path in the traversal | |
*/ | |
async function* files(dir, join) { |
This file contains 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
/** | |
* Checks an array for duplicates | |
* @param {*[]} arr The array to check for duplicates | |
* @returns {Boolean} True when there are duplicates, false when there are none | |
*/ | |
function hasDuplicate(arr) { | |
for (let i = 0, j, ln = arr.length; i < ln; ++i) { | |
for (j = i + 1; j < ln; ++j) { | |
if (arr[i] === arr[j]) return true; | |
} |