Skip to content

Instantly share code, notes, and snippets.

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,
{
"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",
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'));
}
});
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
},
{
@thetallweeks
thetallweeks / unit-test-private-functions.js
Last active February 16, 2016 00:47
A modified version of Phillip Walton's concept for unit testing private methods
// 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';
@thetallweeks
thetallweeks / 0_reuse_code.js
Created December 31, 2015 19:44
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@thetallweeks
thetallweeks / SassMeister-input-HTML.html
Created December 4, 2015 03:49
Generated by SassMeister.com.
<h3>Closer to a real use case</h3>
<div id="some-module">
<p class="disabled">I should be green</p>
<p class="sometimes-special">sometimes special, but parent says no :-(</p>
<p class="never-special">never special</p>
<directive xx-picky>
<p class="disabled">I want to be red, but I can't</p>
</directive>
// currently
function update(id, deployment, local) {
var deferred = $q.defer(),
d = $q.defer();
if (!local) {
$http.patch('/api/deployments/' + id, deployment).success(function (data) {
if (_.isObject(data)) {
d.resolve(deployment);
} else {
Running "shell:mongo" (shell) task
2014-12-31T12:35:41.840-0800 [initandlisten] MongoDB starting : pid=50263 port=27017 dbpath=db 64-bit host=YASSYED-M-95M2
2014-12-31T12:35:41.840-0800 [initandlisten]
2014-12-31T12:35:41.840-0800 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
2014-12-31T12:35:41.840-0800 [initandlisten] db version v2.6.6
2014-12-31T12:35:41.840-0800 [initandlisten] git version: nogitversion
2014-12-31T12:35:41.840-0800 [initandlisten] build info: Darwin minimavericks.local 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
2014-12-31T12:35:41.841-0800 [initandlisten] allocator: tcmalloc
2014-12-31T12:35:41.841-0800 [initandlisten] options: { storage: { dbPath: "db" } }
2014-12-31T12:35:41.841-0800 [initandlisten] journal dir=db/journal
@thetallweeks
thetallweeks / alphabet-object-array.js
Created December 3, 2014 18:12
The Alphabet as an object array
[{letter:'a'},{letter:'b'},{letter:'c'},{letter:'d'},{letter:'e'},{letter:'f'},{letter:'g'},{letter:'h'},{letter:'i'},{letter:'j'},{letter:'k'},{letter:'l'},{letter:'m'},{letter:'n'},{letter:'o'},{letter:'p'},{letter:'q'},{letter:'r'},{letter:'s'},{letter:'t'},{letter:'u'},{letter:'v'},{letter:'w'},{letter:'x'},{letter:'y'},{letter:'z'}]