Skip to content

Instantly share code, notes, and snippets.

🎸
working hard 😎

4rontender RinatValiullov

🎸
working hard 😎
Block or report user

Report or block RinatValiullov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@RinatValiullov
RinatValiullov / deepClone.js
Created Jul 26, 2019
Creates a deep clone of an object.
View deepClone.js
const deepClone = obj => {
let clone = Object.assign({}, obj);
Object.keys(clone).forEach(
key => (clone[key] = typeof obj[key] === 'object' ? deepClone(obj[key]) : obj[key])
);
return Array.isArray(obj) && obj.length
? (clone.length = obj.length) && Array.from(clone)
: Array.isArray(obj)
? Array.from(obj)
: clone;
@RinatValiullov
RinatValiullov / feature_detect_es_modules.js
Created Jun 14, 2019 — forked from ebidel/feature_detect_es_modules.js
Feature detect ES modules: both static import and dynamic import()
View feature_detect_es_modules.js
<!--
Complete feature detection for ES modules. Covers:
1. Static import: import * from './foo.js';
2. Dynamic import(): import('./foo.js').then(module => {...});
Demo: http://jsbin.com/tilisaledu/1/edit?html,output
Thanks to @_gsathya, @kevincennis, @rauschma, @malyw for the help.
-->
View colorsPack.json
[
{
color: "Goldenrod"
},
{
color: "Green"
},
{
color: "Khaki"
},
@RinatValiullov
RinatValiullov / importSL.html
Last active May 19, 2019
Testing import the external code to SoloLearn
View importSL.html
<div>Some external code</div>
@RinatValiullov
RinatValiullov / minification.md
Created Apr 24, 2019 — forked from gaearon/minification.md
How to Set Up Minification
View minification.md

In production, it is recommended to minify any JavaScript code that is included with your application. Minification can help your website load several times faster, especially as the size of your JavaScript source code grows.

Here's one way to set it up:

  1. Install Node.js
  2. Run npm init -y in your project folder (don't skip this step!)
  3. Run npm install terser

Now, to minify a file called like_button.js, run in the terminal:

@RinatValiullov
RinatValiullov / array_method.md
Last active Feb 28, 2019
My Custom Snippets
View array_method.md
{
    "Array Method": {
        "prefix": "arrm",
        "body": [
            "${1|forEach,map,reduce,filter,some,every,find,flat|}((${2:element}, ${3:index}) => {",
            "\t$4",
            "})",
            ""
        ],
@RinatValiullov
RinatValiullov / forlooptask.md
Last active Feb 16, 2019
Classic task about for loop and setTimeout
View forlooptask.md

What needs to be done to get the correct sequence of numbers from 0 to 4 inclusive?

for(var i = 0; i < 5; i++) {
    setTimeout(function() {
        console.log(i);
    }, 0)
}

@RinatValiullov
RinatValiullov / nativeJavaScript.js
Created Oct 25, 2018 — forked from alexhawkins/nativeJavaScript.js
Implementation of Native JavaScript Methods (forEach, Map, Filter, Reduce, Every, Some)
View nativeJavaScript.js
'use strict';
/*****************NATIVE forEACH*********************/
Array.prototype.myEach = function(callback) {
for (var i = 0; i < this.length; i++)
callback(this[i], i, this);
};
//tests
@RinatValiullov
RinatValiullov / hello_OCEANjs.js
Last active Oct 22, 2018
just for fun (npx + __this url__)
View hello_OCEANjs.js
#!/usr/bin/env node
console.log("Hello, OCEANjs!!!");
You can’t perform that action at this time.