This file contains hidden or 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
// file: src/AddressInput.js | |
import {getPropPathValue} from './Misc'; | |
// --- DOM hook | |
const _addressInput = document.querySelector('main input[type="text"]'); | |
function selectAddress(event) { | |
const name = getPropPathValue(event, ['target','constructor','name'], null); | |
if(name == 'HTMLInputElement') { | |
event.target.select(); |
This file contains hidden or 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
defmodule State do | |
# At each stage of computation, State builds a function. That | |
# function accepts an "initial state" as an argument and returns | |
# a tuple containing a final computed value, and a final state | |
# The basis of State accepts a value and returns a function. | |
# The function returned accepts a state and returns a tuple with the | |
# value and the state. | |
def unit(value) do |
This file contains hidden or 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
gist |
This file contains hidden or 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
_.mixin({ | |
// ### _.objMap | |
// _.map for objects, keeps key/value associations | |
objMap: function (input, mapper, context) { | |
return _.reduce(input, function (obj, v, k) { | |
obj[k] = mapper.call(context, v, k, input); | |
return obj; | |
}, {}, context); | |
}, | |
// ### _.objFilter |