This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import _ from 'lodash-fp'; | |
import { createFunctionsChain, groupProperties } from 'utils/collection'; | |
export default function createStoreSection(prefix, samples) { | |
if (samples.some(sample => !sample)) { | |
throw new TypeError('Sample cant be empty'); | |
} | |
const path = (suffix) => `${prefix}/${suffix}`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from | |
[UPDATE_ENTITY_EDITABLE_LOADING]: (state, { data: { entityId, editableFieldName }}) => ({ | |
items: state.items.map(item => item.Id === entityId | |
? { ...item, [`loading${editableFieldName}`]: true } | |
: item), | |
error: null | |
}) | |
// to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shock@shock-notebook:~/dev/atomjs$ cat /usr/bin/libcanvas | |
#!/bin/sh | |
devPath=/home/shock/dev | |
atomPath=$devPath/atomjs | |
libcPath=$devPath/libcanvas | |
# project pathes | |
atomComp=$atomPath/atom-full-compiled.js | |
libcComp=$libcPath/libcanvas-full-compiled.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Идея в том, чтобы парсить колбеки на количество аргументов в заголовке и за счёт этого избежать ненужных вычислений. | |
/***************************************************************/ | |
// Реализация приблизительно такая: | |
function afterCount (callback) { | |
var a = callback.length > 0 ? hardACount() : null; | |
var b = callback.length > 1 ? hardBCount() : null; | |
var c = callback.length > 2 ? hardCCount() : null; | |
callback(a,b,c); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#these are meant to be run in a REPL, and the java one in beanshell of something of the sort: | |
#ruby | |
[1,2,3,4].select{ |x| x.even? } | |
#python | |
[x for x in [1,2,3,4] if not x%2] | |
#or, more norvingly | |
filter(lambda x: not x%2, [1,2,3,4]) | |
#clojure |