Skip to content

Instantly share code, notes, and snippets.

View albburtsev's full-sized avatar
💭
🤔

Alexander Burtsev albburtsev

💭
🤔
View GitHub Profile
@albburtsev
albburtsev / HOCBaseRender.tsx
Created September 6, 2017 11:17 — forked from tejacques/HOCBaseRender.tsx
React Higher Order Components in TypeScript
import * as React from 'react';
import { Component } from 'react';
export default function HOCBaseRender<Props, State, ComponentState>(
Comp: new() => Component<Props & State, ComponentState>) {
return class HOCBase extends Component<Props, State> {
render() {
return <Comp {...this.props} {...this.state}/>;
}
}
@albburtsev
albburtsev / external-motivators.md
Created July 3, 2017 17:43 — forked from kof/external-motivators.md
External things that keep me motivated at work
  1. Open Source being officially part of the job, not just an "after job fun" instead of spending time with the family.
  2. Colleagues one can learn from, not those one needs to clean up after.
  3. Money matters. Only a stupid person can think that money doesn't matter in our capitalistic society. This also includes social security, medical ensurance and any other expenses. I am not mercantile, no.
  4. Soft deadlines. Having time to do things right.
  5. No pressure in being at time every day in the office. We all got our issues.
  6. Workout during working hours. Possibility to go quickly for a run or to the gym.
  7. Office is optional. I prefer to work from any location I want. Sometimes being in the office is nice though.
  8. Good sitting conditions: good chairs, gym ball, stay desk, sofas.
  9. Relaxation room or nap room.
@albburtsev
albburtsev / jquery.placeholder.js
Created January 25, 2011 11:04
Custom placeholder for text input
$.placeHolder = function(input, text) {
var _input = $(input),
_class = 'placeholder';
_value = _input.val();
_input
.focus(function() {
_value = $(this).val();
$(this)
.removeClass(_class)
.val(_value == text ? '' : _value)
@albburtsev
albburtsev / README.md
Created September 27, 2016 08:01 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

Суть бага в Webpack v1.12.11

Шаг 1

Есть модуль A, который импортирует модуль B В процессе первого(!) импорта модуля B происходит его инициализация, которая в коде вебпака происходит следующим образом:

/******/ 		// Check if module is in cache
/******/ if(installedModules[moduleId])
❯ cat .git/hooks/prepare-commit-msg
#!/bin/bash
b=`git symbolic-ref HEAD| sed -e 's|^refs/heads/||' | sed -e 's|_.*||'`
c=`cat $1`
if [ -n "$b" ] && [[ "$c" != "[$b]:"* ]]
then
echo "[$b]: $c" > $1
fi

This example demonstrates how to create a gradient that follows a stroke. This technique is sometimes used to indicate directionality along a curved edge, such as with hierarchical edge bundling.

To start, take any SVG path element and uniformly sample points along the path using getPointAtLength. (This method can also be used for path tweening.) Then, for each segment between adjacent points, compute the miter joint via line-line intersection. Lastly fill each segment by interpolating the start and end colors, here green to red, using the normalized length t along the path. Although each segment is a constant color, there are many segments to give the appearance of a continuous gradient.

This example uses a thin stroke in addition to filling the segments. This avoids antialiasing artifacts due to most

@albburtsev
albburtsev / jquery.tabinsert.js
Last active December 12, 2015 04:19
jQuery textarea tab insert
/*
* Textarea tab insert
* @dependence jQuery>=1.4.2
* @dependence https://github.com/jeresig/jquery.hotkeys
* @author Alexander Burtsev
*/
$('textarea', _form).bind("keydown", "tab", function(e) {
if ( document.selection ) { // IE
var iesel = document.selection.createRange().duplicate();
iesel.text = "\t";
@albburtsev
albburtsev / test.js
Created January 28, 2013 19:20
Casperjs test for URL with auth basic
var casper = require("casper").create();
var argDomain = casper.cli.get("domain"),
argLogin = casper.cli.get("login"),
argPassword = casper.cli.get("password");
if ( !argDomain ) {
casper.echo('USAGE: casperjs login.js --domain=DOMAIN --login=AUTH_LOGIN --password=AUTH_PASSWORD');
casper.exit();
}
@albburtsev
albburtsev / all.profiler.js
Created September 14, 2012 09:46
all.profiler.js
(function() {
if (
!window.console ||
!console.log
) return;
var eventList = [
/* Список событий */
];