Skip to content

Instantly share code, notes, and snippets.

View zoxon's full-sized avatar

Zoxon zoxon

View GitHub Profile
@jtulk
jtulk / index.js
Created December 29, 2016 17:56
A more efficient reducer for adding/editing/removing objects in an array using a hash table
const initialState = {
byId: ['1', '2', '3'],
byHash: {
'1': {id: '1', content: {title: 'item 1'}},
'2': {id: '2', content: {title: 'item 2'}},
'3': {id: '3', content: {title: 'item 3'}}
}
}
const action1 = {
@hfalucas
hfalucas / [1] main.js
Last active February 22, 2025 17:12
[Vue.js] Authentication and Authorization
/**
* Think of this "main.js" file as your application bootstrap.
*/
import Vue from 'vue'
import Resource from 'vue-resource'
import VueRouter from 'vue-router'
import routes from './routes'
import middleware from './middleware'
@zoxon
zoxon / photoshop-hot-keys.md
Last active March 24, 2017 09:49
Часто используемые горячие клавиши для Photoshop

Часто используемые горячие клавиши для Photoshop

Разное

  • Ctrl + TAB – переключение вкладок;
  • Alt + колесико – увеличение/уменьшение масштаба (инструмент «Масштаб»);
  • Зажатый пробел – перетаскивание (инструмент «Рука»);
  • Ctrl + S – сохранить;
  • Ctrl + Z – отмена;
  • Ctrl + Alt + Z – шаг назад (многократный);
  • Ctrl + Shift + Z – шаг вперед (многократный);
@zoxon
zoxon / html-css-rules.md
Last active October 28, 2025 16:37
Требования к верстке

Требования к верстке

HTML

  1. Форматировать код;
  2. Использовать HTML5 теги;
  3. Семантически называть значения у атрибутов(class, name и т.п);
  4. Запрещается транслит(.hapka, .tovar). Можно заменить на .header, .product;
  5. Запрещается сокращать селекторы(.cb, .acc). Можно заменить на .checkbox, .accordion;
  6. Не допускается вложение блочного элемента в строчный. Например, тега заголовка(h1-h6) в ссылку;

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by

Moving to a new branch

Unless there are other circumstances involved, this can be easily done by branching and rolling back.

git branch newbranch
git reset --hard HEAD~3 # Go back 3 commits. You *will* lose uncommitted work.*1
git checkout newbranch

Bittorrent uTorrent disable ads

Turn off ALL Ads/Featured Content/Bundle Crap in Utorrent/Bittorrent:

Options > Preferences > Advanced... Turn ALL settings to false:

  • bt.enable_pulse
  • distributed_share.enable
  • gui.show_notorrents_node
  • offers.left_rail_offer_enabled

#Fixing “WARNING: UNPROTECTED PRIVATE KEY FILE!” on Linux

If you are getting this error then you probably reset the permissions on your hidden .ssh directory in your user folder, and your keys aren’t going to work anymore. It’s very important that these files not be writable by just anybody with a login to the box, so openssh will give you an error if you try to use them.

The full error message:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@mrmlnc
mrmlnc / electron-api.md
Last active December 9, 2025 18:37
Electron API

Базовые возможности

process — это объект, позволяющий получить информацию о типе запущенного процесса (рендеринг или основной процесс), версию Chrome и Electron, а также путь до выполняемого js-файла.

Пользовательские элементы DOM:

Объект File — это абстракция над нативным File, передающая стандартному HTML5 file API путь к физическому расположению файла в файловой системе пользователя.

@learncodeacademy
learncodeacademy / pubsub.js
Created July 29, 2015 02:54
Basic Javascript PubSub Pattern
//events - a super-basic Javascript (publish subscribe) pattern
var events = {
events: {},
on: function (eventName, fn) {
this.events[eventName] = this.events[eventName] || [];
this.events[eventName].push(fn);
},
off: function(eventName, fn) {
if (this.events[eventName]) {