Skip to content

Instantly share code, notes, and snippets.

View aulianov's full-sized avatar

Andrew Ulianov aulianov

View GitHub Profile
@aulianov
aulianov / recursiveFindByKey.js
Last active December 2, 2018 18:45
method of recursive search by key (attribute) of object or array
/**
Рекурсивный Поиск в многомерном массиве или объекте по названию атрибута
в виде отдельной функции
recursiveFindByKey({a: {v: 876}, b:22, c: {s: {x:77}, t: 98987}}, 's')
> [{x: 77}]
*/
const recursiveFindByKey = (obj = {}, key = '') => {
if (!obj || typeof obj !== 'object' || !key || typeof key !== 'string') {
return []
}
/**
* Vkontakte JavaScript API wrapper.
*
* This script meant for simplify development of Vkontakte applications
* using Vkontakte API. Using vk_api() object you can call API methods,
* get HTTP-GET parameters (aka flashVars) in a simple way. You don't need
* to calculate signature parameter, don't need to form request string,
* don't need to implement JSONP-communication. You just connect this script
* to HTML-page using <script> tag, call one function to initialize object
* and one function to perform API-request!
/**
*
* MD5 (Message-Digest Algorithm)
* http://www.webtoolkit.info/
*
**/
var MD5 = function (string) {
function RotateLeft(lValue, iShiftBits) {