Skip to content

Instantly share code, notes, and snippets.

View buralex's full-sized avatar

Oleksandr Burlachenko buralex

View GitHub Profile
https://reactjs.org/docs/refs-and-the-dom.html
https://reactjs.org/docs/lifting-state-up.html
https://reactjs.org/docs/forms.html
https://www.andrewhfarmer.com/use-refs-not-ids/
https://www.divii.org/
@buralex
buralex / uniq.js
Created October 22, 2017 16:24 — forked from telekosmos/uniq.js
Remove duplicates from js array (ES5/ES6)
var uniqueArray = function(arrArg) {
return arrArg.filter(function(elem, pos,arr) {
return arr.indexOf(elem) == pos;
});
};
var uniqEs6 = (arrArg) => {
return arrArg.filter((elem, pos, arr) => {
return arr.indexOf(elem) == pos;
});
@buralex
buralex / regexp
Created September 19, 2017 12:21
str.match(/\[(.*?)\]/)[1] // extracts attribute name from fsdfsda[name]fdsf
@buralex
buralex / AI
Last active September 19, 2017 09:38
/*------------------------------------------------------------------------------------
articles
-------------------------------------------------------------------------------------*/
https://tutorialzine.com/2017/04/10-machine-learning-examples-in-javascript
https://medium.freecodecamp.org/how-to-create-a-neural-network-in-javascript-in-only-30-lines-of-code-343dafc50d49
/*-----------------------------------------------------------------------------------
other
/*------------------------------------------------------------------------------------
activeForm listeners
--------------------------------------------------------------------------------------*/
https://yii2-cookbook.readthedocs.io/forms-activeform-js/
->createCommand()->rawSql
@buralex
buralex / ubuntu
Last active April 24, 2018 07:22
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-16-04
/* when this trouble-> /etc/sudoers is owned by uid 1000, should be 0
*/
pkexec chown root:root /etc/sudoers /etc/sudoers.d -R
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games chmod a+x filename
https://www.howtogeek.com/114884/how-to-repair-grub2-when-ubuntu-wont-boot/
https://www.youtube.com/watch?v=OmMkAGuZxCE
@buralex
buralex / geo.js
Created August 24, 2017 20:57 — forked from mkhatib/geo.js
A Javascript utility function to generate number of random Geolocations around a center location and in a defined radius.
/**
* Generates number of random geolocation points given a center and a radius.
* @param {Object} center A JS object with lat and lng attributes.
* @param {number} radius Radius in meters.
* @param {number} count Number of points to generate.
* @return {array} Array of Objects with lat and lng attributes.
*/
function generateRandomPoints(center, radius, count) {
var points = [];
for (var i=0; i<count; i++) {
https://habrahabr.ru/post/269135/
http://www.vr-online.ru/forum/kak-ustroen-messendzher-tipa-skype-ili-ee-tipovaja-arhitektura-9577
https://github.com/arhangeldim/messenger/wiki/%D0%97%D0%B0%D0%B4%D0%B0%D0%BD%D0%B8%D0%B5-2---Messenger
http://hostciti.net/faq/mysql/arhitektura-db-dlya-messendgera.html
UPDATE drivers
SET latitude = CASE id
WHEN 1133 THEN 38.2546174
WHEN 1134 THEN 37.63950904
END,
longitude = CASE id
WHEN 1133 THEN -84.1931136
WHEN 1134 THEN -85.25878743
END
WHERE id IN (1133,1134)