Skip to content

Instantly share code, notes, and snippets.

@adsurov
adsurov / playground.json
Last active June 10, 2020 21:23
breadcrumbs
{
"scripts": [],
"showConsole": true,
"template": true
}
@adsurov
adsurov / index.html
Last active May 21, 2020 15:17
checkver
<div id="app"></div>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header class="header">
class Observable {
constructor(value, cloneValue) {
this._cloneValue = cloneValue || defaultCloneValue;
this._curValue = this._cloneValue(value);
this._listeners = []; // I think it could be better to use object instead
this._obsoleteListeners = [];
function defaultCloneValue(v) {
try {
return JSON.parse(JSON.stringify(v)) // better use special deep cloningfunction to avoid circular links
@adsurov
adsurov / test
Created January 28, 2020 13:32
sample
‎‎​

Posts

https://egghead.io/
https://github.com/trekhleb/javascript-algorithms
https://habr.com/post/359192/ алгоритмы на js все
https://www.youtube.com/watch?v=j4_9BZezSUA event loop
https://fseby.wordpress.com/2016/02/25/практическая-вводная-в-монады-в-javascript/
https://habrahabr.ru/company/mailru/blog/327522/   (Функциональное программирование в JavaScript с практическими примерами)
https://habrahabr.ru/post/298134/ (FizzBuzz, или почему программисты не умеют программировать)     http://dmitrysoshnikov.com/ecmascript/javascript-the-core-2nd-edition-rus/ (всякое общее)
https://medium.com/@frontman/приведение-типов-в-js-9d6f1845ea96   (приведение типов и др. инфа)  

@adsurov
adsurov / revert-a-commit.md
Created July 22, 2019 06:51 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}'

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@adsurov
adsurov / App.js
Created April 2, 2018 18:42
lists-conditionals--assignment-problem
import React, { Component } from 'react';
import './App.css';
import ValidationComponent from './ValidationComponent/ValidationComponent';
import CharComponent from './CharComponent/CharComponent';
class App extends Component {
state = {
inputLength: null,
inputValue: ''
};