This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add (a, b) { | |
let res = '', c = 0 | |
a = a.split('') | |
b = b.split('') | |
while (a.length || b.length || c) { | |
c += ~~a.pop() + ~~b.pop() | |
res = c % 10 + res | |
c = c > 9 | |
} | |
return res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Задача: build_key_value | |
Flatten the given hash. This is how HTTP libraries pack data when POST requests are made using x-www-form-urlencoded. | |
Example: {"x[0]":"1","x[1]":"2","x[2]":"3"} == solution({"x":["1","2","3"]}) | |
var _ = require('lodash') | |
module.exports = solution = (s, p) => { | |
var r = {}; | |
_.forEach(s, (v, k) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function deepCompare(o1, o2) { | |
let compare = x => { | |
if(x == null) return x; | |
return Object.keys(x).sort() | |
.reduce((a,b)=>{ | |
if( Array.isArray(x[b]) ) { | |
a[b] = x[b].map(side=>JSON.stringify(compare(side))) | |
} else if( typeof x[b] == 'object' && x[b] != null ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place your settings in this file to overwrite the default settings | |
{ | |
"window.zoomLevel": 1, | |
"editor.tabSize": 2, | |
"eslint.enable": true, | |
"eslint.options": { | |
"rules": { | |
"semi": 2, | |
"comma-dangle": 2, // disallow or enforce trailing commas | |
"no-cond-assign": 2, // disallow assignment in conditional expressions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const NODE_ENV = process.env.NODE_ENV || 'pokestars'; | |
const webpack = require('webpack'); | |
const fs = require('fs'); | |
const path = require('path'); | |
let homeWork = fs.readdirSync(path.join(__dirname, 'home_work')) | |
.reduce((a, lesson) => { | |
a[lesson] = fs.readdirSync(path.join(__dirname + '/home_work', lesson)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#atom-sync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let asd = 'hi' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2016-12-02T21:31:24.262Z"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place your settings in this file to overwrite the default settings | |
{ | |
"extensions.autoUpdate": true, | |
"flow.enabled": true, | |
"window.zoomLevel": 1, | |
"files.associations": { | |
"*.css": "scss" | |
}, | |
// "editor.fontFamily": "Fira Code", | |
"editor.fontLigatures": true, |
OlderNewer