Skip to content

Instantly share code, notes, and snippets.

@victor-homyakov
victor-homyakov / links - bfcache.md
Last active June 26, 2022 16:46
Ссылки для презентации "BFCache, или Туда и обратно"

Принципы разработки Амплифера

Тут перечислены не законы, последние слово всегда за здравым смыслом. Тут перечислены лишь направление, куда надо стремиться. Принципы, которые должны помочь, когда не знаешь, что выбрать.

Ценности

  1. Пользователь. Если что-то сильно мешает UX или есть критическая ошибка, то в первую очередь мы спасаем пользователей. Для этого иногда надо взять ответственность на себя, переубедить толпу, написать плохой код.
@yyx990803
yyx990803 / commits.vue
Last active May 13, 2022 16:43
Vue examples comparisons in 2.x and function-based APIs
<template>
<div id="demo">
<h1>Latest Vue.js Commits</h1>
<template v-for="branch in branches">
<input type="radio"
:id="branch"
:value="branch"
name="branch"
v-model="currentBranch">
<label :for="branch">{{ branch }}</label>
@lhorie
lhorie / longest-keyword-sequence.md
Last active November 14, 2022 23:21
What's the longest keyword sequence in Javascript?
@loilo
loilo / pass-slots.md
Last active July 23, 2024 08:08
Vue: Pass Slots through from Parent to Child Components

Vue: Pass Slots through from Parent to Child Components

The Situation

  • We've got some components A, B and C which provide different slots.
    const A = {
      template: `<div><slot name="a">Default A Content</slot></div>`
    }

const B = {

@igogrek
igogrek / Vue code style.md
Last active May 29, 2024 01:58
Code style and application structure

Application structure

General

  1. Application has tree structure with folders for each "feature"
  2. Feature folders are named with lowerCamelCase → myComponentDashboard
  3. Feature can contain any number of components and nested features
  4. Components are named using UpperCamelCase → MyWidgetComponent.vue
  5. Component can have translation .yml file named correspondingly → MyWidgetComponent.yml
  6. If component requires more than 2 files: .vue and .yml file - folder is created with the same name → MyWidgetComponent
@moreta
moreta / vue_devtool_open_component_in_editor.md
Last active August 19, 2022 07:44
Vue devtool Open component in editor tips
@DawidMyslak
DawidMyslak / vue.md
Last active April 22, 2024 12:49
Vue.js and Vuex - best practices for managing your state

Vue.js and Vuex - best practices for managing your state

Modifying state object

Example

If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assign() (or spread operator).

Example below explains implications for different implementations.

@nalgeon
nalgeon / suggest-xmlhttp.js
Last active September 14, 2020 14:40
Пример работы с подсказками DaData на JScript + XMLHTTP
var API_KEY = "ВАШ_API_КЛЮЧ";
function suggest(resource, query) {
var http = new ActiveXObject("MSXML2.XMLHTTP");
http.open("POST", "http://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/" + resource, false);
http.setRequestHeader("Content-Type", "application/json");
http.setRequestHeader("Authorization", "Token " + API_KEY);
var data = "{ \"query\": \"" + query + "\" }";
http.send(data);
@nalgeon
nalgeon / suggest.vbs
Last active April 9, 2024 03:22
Пример работы с подсказками DaData на VBScript
Dim http
Set http = CreateObject("WinHttp.WinHttpRequest.5.1")
timeout = 2000 'milliseconds
http.SetTimeouts timeout, timeout, timeout, timeout
query = "7719402047"
request = "{ ""query"": """ & query & """ } "
http.Open "POST", "https://suggestions.dadata.ru/suggestions/api/4_1/rs/findById/party"
http.SetRequestHeader "Content-Type", "application/json"