Skip to content

Instantly share code, notes, and snippets.

View buralex's full-sized avatar

Oleksandr Burlachenko buralex

View GitHub Profile
/*------------------------------------------------------------------------------------
activeForm listeners
--------------------------------------------------------------------------------------*/
https://yii2-cookbook.readthedocs.io/forms-activeform-js/
->createCommand()->rawSql
@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
@buralex
buralex / regexp
Created September 19, 2017 12:21
str.match(/\[(.*?)\]/)[1] // extracts attribute name from fsdfsda[name]fdsf
@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;
});
https://www.divii.org/
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/
@buralex
buralex / LICENSE
Created November 15, 2017 11:47 — forked from ourmaninamsterdam/LICENSE
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@buralex
buralex / citystategeo.js
Last active January 2, 2018 08:37 — forked from danasilver/citystategeo.js
Get only city and state from Google Maps API Reverse Geocoder
for (var ac = 0; ac < results[0].address_components.length; ac++) {
var component = results[0].address_components[ac];
switch(component.types[0]) {
case 'locality':
storableLocation.city = component.long_name;
break;
case 'administrative_area_level_1':
storableLocation.state = component.short_name;
break;
@buralex
buralex / limitLoop.js
Created February 4, 2018 13:57 — forked from addyosmani/limitLoop.js
Limit the frame-rate being targeted with requestAnimationFrame
/*
limitLoop.js - limit the frame-rate when using requestAnimation frame
Released under an MIT license.
When to use it?
----------------
A consistent frame-rate can be better than a janky experience only
occasionally hitting 60fps. Use this trick to target a specific frame-
rate (e.g 30fps, 48fps) until browsers better tackle this problem
@buralex
buralex / mongodb
Last active February 22, 2018 10:40
https://stackoverflow.com/questions/14226410/node-js-cannot-find-module-mongodb
npm install mongodb -g
cd /path/to/my/app/folder
npm link mongodb
With that in place, I could do this in my application file: require('mongodb').
/**/
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-mongodb-on-ubuntu-16-04