Skip to content

Instantly share code, notes, and snippets.

@DChinin
DChinin / lg.yml
Created March 24, 2017 08:11 — forked from mseeley/lg.yml
Known LG devices
---
- headers: |
User-Agent: (LGSmartTV/1.0) AppleWebKit/534.23 OBIGO-T10/2.0
result:
browser:
name: Obigo T
version: "10"
engine:
name: Webkit
version: "534.23"
@DChinin
DChinin / tmux.md
Created December 13, 2016 18:52 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@DChinin
DChinin / tmux-cheatsheet.markdown
Created September 9, 2016 16:08 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@DChinin
DChinin / interview.md
Last active August 13, 2018 11:50
Frontend interview

Workflow:

  • Расскажите о своей среде разработки (ОС, редактор, браузер(ы), прочие инструменты)
  • Какую VCS используете? Как работали в команде? PR, методологии, оценка времени
  • Использовали CI?
  • Как узнаете о новинках в мире JS? Какие конференции/митапы посятили за последние полгода? Какую технологию изучили недавно?

Базовые вопросы

  • Как браузер отрисовывает HTML-страницу на экране? (что происходит после получения ответа от сервера)
@DChinin
DChinin / tips.md
Last active January 18, 2016 09:11
Vim guide

Перемещение

Клавиша/Команда Описание
:e! отменяет все изменения, сделанные за сеанс
h,j,k,l перемещение курсора ←, ↓, ↑, →
0 переход в начало строки
$ переход в конец строки
^ переход на первый непустой символ
w вперед на слово
@DChinin
DChinin / index.html
Created November 21, 2015 10:45 — forked from RubaXa/index.html
CSS vs. Inline style (http://jsbench.github.io/#a9283bb254143ea63d7c) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>CSS vs. Inline style</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@DChinin
DChinin / what-forces-layout.md
Created September 29, 2015 06:46 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
(function(win){
'use strict';
var doc = win.document, simpleRe = /^(#?[\w-]+|\.[\w-.]+)$/, periodRe = /\./g, slice = [].slice;
win.query = function(selector, context){
context = context || doc;
if(simpleRe.test(selector)){
switch(selector.charAt(0)){
case '#':
@DChinin
DChinin / package.json
Created September 25, 2014 05:45
Package.json for async module
{"name":"async","description":"Higher-order functions and common patterns for asynchronous code","main":"./lib/async","author":{"name":"Caolan McMahon"},"version":"0.2.10","repository":{"type":"git","url":"https://github.com/caolan/async.git"},"bugs":{"url":"https://github.com/caolan/async/issues"},"licenses":[{"type":"MIT","url":"https://github.com/caolan/async/raw/master/LICENSE"}],"devDependencies":{"nodeunit":">0.0.0","uglify-js":"1.2.x","nodelint":">0.0.0"},"jam":{"main":"lib/async.js","include":["lib/async.js","README.md","LICENSE"]},"scripts":{"test":"nodeunit test/test-async.js"},"_id":"async@0.2.10","dist":{"shasum":"b6bbe0b0674b9d719708ca38de8c237cb526c3d1","tarball":"http://registry.npmjs.org/async/-/async-0.2.10.tgz"},"_from":"async@~0.2.6","_npmVersion":"1.3.2","_npmUser":{"name":"caolan","email":"caolan.mcmahon@gmail.com"},"maintainers":[{"name":"caolan","email":"caolan@caolanmcmahon.com"}],"directories":{},"_shasum":"b6bbe0b0674b9d719708ca38de8c237cb526c3d1","_resolved":"https://registry.npmjs.
var stringToDom = function(str) {
var wrapMap = {
option: [1, '<select multiple="multiple">', '</select>'],
legend: [1, '<fieldset>', '</fieldset>'],
area: [1, '<map>', '</map>'],
param: [1, '<object>', '</object>'],
thead: [1, '<table>', '</table>'],
tr: [2, '<table><tbody>', '</tbody></table>'],
col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
td: [3, '<table><tbody><tr>', '</tr></tbody></table>'],