Skip to content

Instantly share code, notes, and snippets.

View a-x-'s full-sized avatar
🛩️

Alexander a-x-

🛩️
View GitHub Profile
@a-x-
a-x- / env
Last active August 5, 2016 11:32
env
TERM_SESSION_ID=w1t3p1:20FCC60B-CC1F-472B-88A7-346396B3644A
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.HcUz0Cvnvy/Listeners
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.HevUwiyDr2/Render
COLORFGBG=11;15
ITERM_PROFILE=Default
XPC_FLAGS=0x0
PWD=/Users/invntrm/Ya/Projects/fiji
SHELL=/bin/zsh
SECURITYSESSIONID=186a8
mvim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 19 2016 06:30:38)
MacOS X (unix) version
Included patches: 1-1090
Compiled by Homebrew
Huge version without GUI. Features included (+) or not (-):
+acl +farsi +mouse_netterm +syntax
+arabic +file_in_path +mouse_sgr +tag_binary
+autocmd +find_in_path -mouse_sysmouse +tag_old_static
-balloon_eval +float +mouse_urxvt -tag_any_white
@a-x-
a-x- / inheritance-demo.cpp
Created August 11, 2016 10:34
Вспомнить наследование в c++ / Компиляция и запуск на маке: `clang -O3 -stdlib=libstdc++ inherit.cpp -o inherit&&./inherit`
// clang -O3 -stdlib=libstdc++ inherit.cpp -o inherit&&./inherit
#include <stdio.h>
#include <stdlib.h>
class iBem {
protected: int setMod(){return 1;};
};
/*
4002 silly gunzTarPerm extractEntry _DataView.js
4003 silly gunzTarPerm extractEntry zipObject.js
4004 silly gunzTarPerm extractEntry commit.js
4005 silly gunzTarPerm extractEntry zipWith.js
4006 silly gunzTarPerm extractEntry compact.js
4007 silly gunzTarPerm extractEntry fp/F.js
4008 silly gunzTarPerm extractEntry fp/keysIn.js
4009 silly gunzTarPerm extractEntry fp/lang.js
4010 silly gunzTarPerm extractEntry fp/last.js
4011 silly gunzTarPerm extractEntry fp/keys.js
import ButtonNormal from ‘libs/bem/desktop/button/_theme/button_theme_normal’
import ButtonS from ‘libs/bem/desktop/button/_size/button_size_s’
import ButtonLink from ‘libs/bem/desktop/button/_type/button_type_link’
// Наследование для удобства, но не обязательное.
class ButtonNormalS extends ButtonNormal {
constructor(props){super({…props, mods: {…this.mods, size:’s’}})}
}
// …
// Подмешивание модификаторов без наследования
render(){return <div block=”foo”><ButtonNormalS mods={{type:’link’}} mix={{elem:’bar’}} text=”Яндекс” /></div><div>…</div>”}
<div class=”cart form”> // buisness-block cart mixed with lib-block form
<div class="__item"></div> // is it cart__item or form__item?
</div>
(()=>{
const cl = console.log.bind(console)
const rand = (from, to) => Math.round(Math.random() * (to - from) - from)
const length = 10
const from = 0
const to = 100
// const write = (val) => (window.val.innerText = val) // -> #val
const input = Array(length).fill()
@a-x-
a-x- / find-elem-mods-warns.js
Last active September 7, 2016 12:17
Поиск блоков link, button и др. без {mods:{theme,size}} и с потенциально неправильными {elem,mods} #bemhtml #lego #bem ➔ ➔ ➔ MOVED: https://github.com/a-x-/find-ast-objects
#!/usr/env node
// env: VERBOSE
// usage: VERBOSE=1 node find-elem-mods-warns.js | less
// usage: subl -n $(node find-elem-mods-warns.js)
const acorn = require('acorn')
const fs = require('fs')
const Glob = require('glob')
const escodegen = require('escodegen')
const estraverse = require('estraverse')
[core]
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol,space-before-tab
quotepath = false # Чтобы не упячилась кириллица в путях
editor = mvim -v
[merge]
tool = ws
conflictstyle = merge #diff3
[mergetool "ws"]
@a-x-
a-x- / .eslintrc
Created September 27, 2016 11:41
{
"globals": {
"JSON": false,
"BEM": false,
"BEMHTML": false,
"bh": false,
"Lego": false,
"console": false
},
"rules": {