I hereby claim:
- I am googgah on github.
- I am googgah (https://keybase.io/googgah) on keybase.
- I have a public key whose fingerprint is 1775 4DD5 3247 CFE2 E2CD F74C EF03 EC1A 466A 90F7
To claim this, I am signing this object:
| /** ********************************* | |
| * return the contents of the array "arr" divided into "n" equally sized arrays | |
| * | |
| * @param {number[]} arr - input array | |
| * @param {integer} n - number of resulting arrays | |
| */ | |
| const groupArrayElements = (arr, n) => { | |
| if (n === 1) { | |
| return [arr] |
| const replacer = function( depth = Number.MAX_SAFE_INTEGER ) { | |
| let objects, stack, keys; | |
| return function(key, value) { | |
| // very first iteration | |
| if (key === '') { | |
| keys = ['root']; | |
| objects = [{keys: 'root', value: value}]; | |
| stack = []; | |
| return value; | |
| } |
| const promise = require('bluebird'); | |
| const net = require('net'); | |
| const config = require('someConfigTool'); | |
| // --------------------------------- | |
| // most probably MySQL server will start together with ours(this one) | |
| // so we have to wait until it up | |
| let tryOnce_ = (opts) => { | |
| return new promise((resolve, reject) => { | |
| let client = new net.Socket(); |
| /** | |
| * combine objects | |
| * | |
| * gets arrays with possible @param values, like | |
| * [{a:1},{a:2}], [{b:'one'}, {b:'two'}], [{c:4,d:5},{c:7,d:9}] | |
| * @returns all param values combinations | |
| * [{ a: 1, b: 'one', c: 4, d: 5 }, | |
| * { a: 2, b: 'one', c: 4, d: 5 }, | |
| * { a: 1, b: 'two', c: 4, d: 5 }, | |
| * { a: 2, b: 'two', c: 4, d: 5 }, |
| var fs = require( 'fs' ); | |
| var path = require( 'path' ); | |
| // path/path/*.html → array of files | |
| var resolve_glob = function( glob ) { | |
| if ( glob.indexOf( '*' ) !== -1 || glob.indexOf( '?' ) !== -1 ) { | |
| var re = new RegExp( '^' + path.basename( glob ).replace( /\./g, '\.' ).replace( /\*/g, '.*' ).replace( /\?/g, '.' ) + '$' ), | |
| dir = path.normalize( path.dirname( glob ) + '/' ); | |
| return fs.readdirSync( dir ).filter( function( f ) { |
| [user] | |
| name = dmitry_t | |
| email = [email protected] | |
| [core] | |
| autocrlf = input | |
| safecrlf = true # it can be your headache .. | |
| whitespace = -indent-with-non-tab,-trailing-space,-space-before-tab,cr-at-eol | |
| [alias] |
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| # this pre-receive hook returns error when you are trying to push your silly code to the PRODUCTION branch not being member of repo administrators group | |
| REPOADMINGROUP='repo-admin' | |
| GROUPS_=`groups` | |
| PRODUCTIONBRANCH='master' | |
| while read oldsha newsha REFNAME; do | |
| #!/bin/bash | |
| # 2 points assumed | |
| # * web server and repository are/can-be placed on different boxes | |
| # * one can login to repository box without manual password entering - rsa keys are keychained by ssh-agent | |
| PRODUCTIONBRANCH='master' | |
| DEVBRANCH='dev' | |
| PRODUCTIONPATH='/var/www/path/to/prod/server' | |
| DEVPATH='/var/www/path/to/dev/server' |