Skip to content

Instantly share code, notes, and snippets.

🚄
Making treo.sh

Aleksey Kulikov alekseykulikov

🚄
Making treo.sh
Block or report user

Report or block alekseykulikov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .bash_profile
export PATH=/usr/local/bin:/usr/local/share/npm/bin:$PATH
PS1="\w \[\033[32m\]\$(parse_git_branch) \[\033[37m\]$\[\033[00m\] "
alias ll='ls -alFG'
# git aliases
alias ga='git add -A && gc'
alias gb='git branch'
alias gc='git commit -v'
alias gd='git diff'
@alekseykulikov
alekseykulikov / .jshintrc
Last active Aug 29, 2015
My code style validation: ~/.jshintrc with atom's linter + linter-jshint
View .jshintrc
{
// validate code
"freeze": true, // prohibits overwriting prototypes
"unused": true,
"undef": true,
// relaxing options
"expr": true, // suppresses warnings about expressive expressions, like ?
"laxbreak": true, // allow line breaking
"lastsemic": true, // suppresses warnings about last missing semicolon
@alekseykulikov
alekseykulikov / .jscsrc
Last active Aug 29, 2015
Code Style: ~/.jscsrc and atom's linter + linter-jscs
View .jscsrc
{
"preset": "node-style-guide",
"requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties", // for external APIs
"requireCapitalizedComments": null, // why???
"requireCurlyBraces": null, // allow one lines
"requireTrailingComma": null, optional
// personal style
"maximumLineLength": { // 80 is a goal, but sometimes it's necessary
"value": 120,
@alekseykulikov
alekseykulikov / wrap-generator.js
Created Jul 1, 2015
Wrap koa-like generators to express-like callbacks.
View wrap-generator.js
var co = require('co')
/**
* Wrap koa-like generators to express-like callbacks.
*
* @param {GeneratorFunction} fn
* @return {Function}
*/
modules.exports = function wrap(fn) {
@alekseykulikov
alekseykulikov / terminal.log
Last active Oct 24, 2015
Estimate production size of npm front-end package
View terminal.log
$ npm i -g browserify uglify-js pretty-bytes
$ npm i react
$ browserify node_modules/react | uglifyjs -m | gzip | wc -c | pretty-bytes
> 51.58 kB
$ npm i backbone jquery
$ browserify node_modules/backbone | uglifyjs -m | gzip | wc -c | pretty-bytes
> 41.99 kB
$ npm i socket.io-client
$ browserify node_modules/socket.io-client | uglifyjs -m | gzip | wc -c | pretty-bytes
> 20.64 kB
@alekseykulikov
alekseykulikov / index.js
Last active Dec 18, 2015
Use es6 generators to simplify async calls.
View index.js
/**
* Required node >= v0.11.2
* usage: node --harmony index.js
*/
var fs = require('fs');
var run = require('./run');
function readFile(filename) {
return fs.readFile.bind(fs, filename, 'utf-8');
@alekseykulikov
alekseykulikov / Readme.md
Last active Oct 30, 2017
lodash vs underscore size comprasion
View Readme.md

In reply to Jeremy's tweet, that underscore is 3x smaller (simpler?) than Lodash! https://twitter.com/jashkenas/status/568564455937839106

Apparently, it's only true if you use <script> tag, but if you use lodash's module feature and build your project with browserify(or webpack) you get different numbers. In simple cases underscore can be 4-6 times bigger.

15020 bundle-lodash-without.js
 4820 bundle-lodash-without.min.js
 1647 bundle-lodash-without.min.js.gz
View apple.lighthouse.report.json
{
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3821.0 Safari/537.36",
"environment": {
"networkUserAgent": "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3694.0 Mobile Safari/537.36 Chrome-Lighthouse",
"hostUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/77.0.3821.0 Safari/537.36",
"benchmarkIndex": 1118
},
"lighthouseVersion": "5.0.0",
"fetchTime": "2019-06-11T12:26:25.143Z",
"requestedUrl": "https://www.apple.com/",
@alekseykulikov
alekseykulikov / index.md
Last active Nov 12, 2019
Principles we use to write CSS for modern browsers
View index.md

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

You can’t perform that action at this time.