Skip to content

Instantly share code, notes, and snippets.

View chayn1k's full-sized avatar

Pavel Tchaikovsky chayn1k

View GitHub Profile
@pgilad
pgilad / Instructions.md
Last active March 31, 2024 22:30
Git commit-msg hook to validate for jira issue or the word merge

Instructions

  • copy the file commit-msg to .git/hooks/commit-msg
  • make sure your delete the sample file .git/hooks/commit-msg.sample
  • Make commit msg executable. chmod +x .git/hooks/commit-msg
  • Edit commit-msg to better fit your development branch, commit regex and error message
  • Profit $$

Shell example

@kchida
kchida / gist:d1c15f3968f4f8272c49
Created July 17, 2014 05:06
etcd vs consul vs ???
- What do Etcd, Consul, and Zookeeper do?
- Service Registration:
- Host, port number, and sometimes authentication credentials, protocols, versions
numbers, and/or environment details.
- Service Discovery:
- Ability for client application to query the central registry to learn of service location.
- Consistent and durable general-purpose K/V store across distributed system.
- Some solutions support this better than others.
- Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
- Centralized locking can be based on this K/V store.
@gruzzilkin
gruzzilkin / css-stylus-with-if-ie-ie9.js
Last active August 29, 2015 14:01
bemup-2014-msk | Вопросы
var autoprefixer = require('autoprefixer');
module.exports = require('enb/techs/css-stylus').buildFlow()
.name('css-stylus-with-if-ie-ie9')
.defineOption('autoprefixerArguments')
.target('target', '?.ie9.css')
.useFileList(['css', 'ie9.css', 'styl'])
.methods({
_configureRenderer: function(renderer) {
var args = this._autoprefixerArguments;
@arikon
arikon / i-jquery__my-plugin.js
Created February 1, 2014 16:35
jQuery plugin with bem-core
// If you are using borschik to expand links (bem make and enb do this for you)
// you could use this hack for any jQuery plugin found in the wild
modules.define('i-jquery__my-plugin', ['jquery'], function(provide, $){
var jQuery = $,
window = {jQuery: jQuery};
/*borschik:include:path/to/jquery-plugin.js*/
provide($);
});
@jcppkkk
jcppkkk / OpenWithSublime.bat
Last active July 2, 2025 23:21 — forked from FoxColdMetal/OpenWithSublimeText.bat
[[[ Move to https://github.com/jcppkkk/OpenWithSublime !!! ]]] Add context menu to allow user open file or folder with Sublime as User (or as Admin).
@echo off
:: Path to Sublime Text installation dir.
SET stPath=%~dp0sublime_text.exe
SET stPathOnly=%~dp0
:: Key name for the registry entries.
SET UserEntry=Sublime Text
SET AdminEntry=Sublime Text As Admin
:: Context menu texts.
SET "UserMenuText=Open with Sublime(&-)"
SET "AdminMenuText=Open with Sublime As Admin(&+)"
@dr-dimitru
dr-dimitru / Social RESTful URLs snippet.md
Last active January 28, 2023 03:57
Social links, +1s and shares using only HTML (no JS)
@larchanka
larchanka / uniqid.js
Last active October 27, 2019 08:51
JavaScript function that copies functionality of PHP's 'uniqid'.
(function () {
this.uniqid = function (pr, en) {
var pr = pr || '', en = en || false, result;
this.seed = function (s, w) {
s = parseInt(s, 10).toString(16);
return w < s.length ? s.slice(s.length - w) : (w > s.length) ? new Array(1 + (w - s.length)).join('0') + s : s;
};
result = pr + this.seed(parseInt(new Date().getTime() / 1000, 10), 8) + this.seed(Math.floor(Math.random() * 0x75bcd15) + 1, 5);
(function ($, BEM) {
'use strict';
var CHANNEL_NAME = 'statistic';
var CHANNEL_EVENT_HIT = 'hit';
var CHANNEL_EVENT_REACH_GOAL = 'reachGoal';
BEM.DOM.decl({
block: 'i-yandexMetrika'
}, {
@A
A / Gruntfile.js
Last active December 22, 2015 17:19
'use strict';
var path = require('path');
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var folderMount = function folderMount(connect, point) {
return connect.static(path.resolve(point));
};
module.exports = function (grunt) {
// grunt || grunt browser — разработка в браузере
@ebidel
ebidel / Web Components Resources.md
Last active October 12, 2024 17:10
List of resources related to Web Components