Skip to content

Instantly share code, notes, and snippets.

Aleksandar Djindjic djindjic

Block or report user

Report or block djindjic

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
@ivan-nikitovic
ivan-nikitovic / map.js
Last active Nov 2, 2017
Redux - Map array with conditional modification
View map.js
const map = array => ({
when: condition => ({
then: modification => array.map(
(item, index, collection) => condition(item, index, collection) ? modification(item, index, collection) : item,
),
}),
});
map([1, 2, 3]).when(number => number > 1).then(number => number * 2) // [1, 4, 6]
@staltz
staltz / introrx.md
Last active Aug 23, 2019
The introduction to Reactive Programming you've been missing
View introrx.md
@WebReflection
WebReflection / Object.getOwnPropertyDescriptors.js
Created Mar 3, 2014
A plural ES5 + ES6 friendly version of Object.getOwnPropertyDescriptor
View Object.getOwnPropertyDescriptors.js
'getOwnPropertyDescriptors' in Object || (
Object.getOwnPropertyDescriptors = function (Object) {
var
gOPD = Object.getOwnPropertyDescriptor,
gOPN = Object.getOwnPropertyNames,
gOPS = Object.getOwnPropertySymbols,
gNS = gOPS ? function (object) {
return gOPN(object).concat(gOPS(object));
} :
gOPN,
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active Aug 15, 2019
JS: AngularJS Directive Attribute Binding Explanation
View angularjs_directive_attribute_explanation.md

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
You can’t perform that action at this time.