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 Tom Gruner @ http://stackoverflow.com/a/12034334/1660815 | |
var entityMap = { | |
"&": "&", | |
"<": "<", | |
">": ">", | |
'"': '"', | |
"'": ''', | |
"/": '/' | |
}; |
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 find from "lodash/find"; | |
import get from "lodash/get"; | |
import isEmpty from "lodash/isEmpty"; | |
import api from "utils/api"; | |
import { createSelector } from "reselect"; | |
import { | |
actionTypesFor, | |
actionCreatorsFor, | |
selectorsFor, |
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
{ | |
"data_schema": { | |
"group": "", | |
"name": "String", | |
"title": "String", | |
"description": "String datatype inherited from Generic datatypes", | |
"type": "datatype.string", | |
"base_type": "datatype", | |
"inherits": "generic.datatype", | |
"version": "1.0.0", |
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 findTableIds(properties) { | |
const ids = map(properties, (property, key) => { | |
if (get(property, 'lhv_table')) { | |
return key; | |
} | |
else if (key === 'input') { | |
return findTableIds(get(property, 'properties')); | |
} | |
}); |
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
var response = { | |
title: 'Genesis 1:2-3', // what is x-gen? | |
verses: [ | |
{ // first verse (we'll loop through if there are many) | |
osisID: 'Gen.1.2', | |
words: [ | |
{ // words not within <w> are converted to this | |
$: 'The' // $ is always a string value | |
}, | |
{ |
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
.highlight .hll { background-color: #ffffcc } | |
.highlight .c { color: #999988; font-style: italic } /* Comment */ | |
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ | |
.highlight .k { color: #000000; font-weight: bold } /* Keyword */ | |
.highlight .o { color: #000000; font-weight: bold } /* Operator */ | |
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */ | |
.highlight .cp { color: #999999; font-weight: bold; font-style: italic } /* Comment.Preproc */ | |
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */ | |
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ | |
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ |
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
http://jsperf.com/another-memoization-comparison | |
// underscore.js memoize | |
function memoize1(func) { | |
"use strict"; | |
var memo = {}; | |
var slice = Array.prototype.slice; | |
return function() { | |
var key = "" + slice.call(arguments); | |
return (key in memo) ? memo[key] : (memo[key] = func.apply(this, arguments)); |
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
['aqua', 'black', 'blue', 'fuchsia', 'gray', 'green', 'lime', 'maroon', 'navy', 'olive', 'orange', 'purple', 'red', 'silver', 'teal', 'white', 'yellow']; |
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
// modified version of: http://philipwalton.com/articles/how-to-unit-test-private-functions-in-javascript/ | |
// uses grunt-strip-code npm package during build | |
var myModule = (function() { | |
var api = { | |
bar: bar | |
}; | |
var _bar = 'bar'; | |
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 getPrevious(n, className) { | |
var y = n.previousSibling; | |
// Check if previous node is an element node with a specific class | |
while (y.nodeType != 1 || !y.classList.contains(className)) { | |
// If not, move on to previous node | |
y = y.previousSibling; | |
} | |
return y; | |
} |
NewerOlder