Skip to content

Instantly share code, notes, and snippets.

View sergey-shambir's full-sized avatar

Sergey Shambir sergey-shambir

  • iSpring Solutions
View GitHub Profile
@sergey-shambir
sergey-shambir / console output.txt
Created October 31, 2019 11:20
noverify random crashes
2019/10/31 14:17:25.860031 built without version info (try using 'make install'?)
2019/10/31 14:17:25.860407 Started
fatal error: concurrent map read and map write
goroutine 36 [running]:
runtime.throw(0xa11c94, 0x21)
/snap/go/4668/src/runtime/panic.go:774 +0x72 fp=0xc00021ef30 sp=0xc00021ef00 pc=0x430c82
runtime.mapaccess2_faststr(0x965580, 0xc0000a0b70, 0xc0032c60a0, 0x20, 0xc00021f3a0, 0xc002f9f500)
/snap/go/4668/src/runtime/map_faststr.go:116 +0x48f fp=0xc00021efa0 sp=0xc00021ef30 pc=0x41497f
github.com/VKCOM/noverify/src/meta.(*info).GetClass(...)
@sergey-shambir
sergey-shambir / todo.js
Created July 5, 2019 04:08
To-Do App JS, layer 5
function onPageLoaded() {
// ...
function listenDeleteTodo(element) {
// ...
}
function loadTodos() {
const data = localStorage.getItem("todos");
if (data) {
@sergey-shambir
sergey-shambir / todo.js
Created July 5, 2019 04:05
To-Do App JS, layer 4
function onPageLoaded() {
const saveButton = document.querySelector("button.save");
const clearButton = document.querySelector("button.clear");
const showTipsButton = document.querySelector("button.showTips");
const closeTipsButton = document.querySelector("a.closeTips");
const overlay = document.querySelector("#overlay");
// ..
saveButton.addEventListener("click", () => {
@sergey-shambir
sergey-shambir / todo.js
Created July 5, 2019 04:03
To-Do App JS, layer 2
function onPageLoaded() {
// ...
function createTodo() {
// ...
listenDeleteTodo(deleteBtn);
}
function listenDeleteTodo(element) {
element.addEventListener("click", (event) => {
element.parentElement.remove();
@sergey-shambir
sergey-shambir / todo.js
Last active July 5, 2019 04:03
To-Do App JS, layer 3
function onPageLoaded() {
// ...
function createTodo() {
// ...
}
function onClickTodo(event) {
if (event.target.tagName === "LI") {
event.target.classList.toggle("checked");
}
@sergey-shambir
sergey-shambir / todo.js
Created July 5, 2019 03:58
To-Do App JS, v1
function onPageLoaded() {
const input = document.querySelector("input[type='text']");
const ul = document.querySelector("ul.todos");
function createTodo() {
const li = document.createElement("li");
const textSpan = document.createElement("span");
textSpan.classList.add("todo-text");
const newTodo = input.value;
textSpan.append(newTodo);
@sergey-shambir
sergey-shambir / todo.css
Last active February 14, 2020 18:36
To-Do List App CSS
html {
min-height: 100%;
}
body {
min-height: 100%;
height: 100%;
font-family: Bad Script;
background: #91eae4;
/* fallback for old browsers */
@sergey-shambir
sergey-shambir / index.html
Last active July 3, 2019 05:00
To-Do List App HTML Skeleton
<!DOCTYPE html>
<html>
<head>
<title>Приложение To-Do List</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/todo.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Bad+Script">
<link rel="shortcut icon" href="assets/favicon.ico">
<link rel="icon" type="image/gif" href="assets/animated_favicon.gif">
@sergey-shambir
sergey-shambir / git-summary.md
Last active April 22, 2024 05:15
Как собирать общую статистику по git репозиторию

Как собирать общую статистику по git репозиторию

Команда git summary

Команда git summary не является встроенной и требует установки пакета git-extras

С помощью команды можно узнать процент авторства исходного кода проекта:

# Количество и процент написанных разработчиком строк во всех файлов проекта
@sergey-shambir
sergey-shambir / eventbus.go
Created December 3, 2018 08:01
Another EventBus implementation
// Package eventbus provides event publisher/subscriber support.
// It's inspired by https://github.com/asaskevich/EventBus
// There are differences in API and implementation
// - deadlock prevention: this eventbus doesn't lock mutex when callbacks are called
// - API based on EventID and Event interface instead of strings and variadic arguments list
package eventbus
import (
"sync"