const name = [];
for (let i = 0; i < res.trails.length; i++){
name[i] = res.trails[i]['name'].replace(/\s/g, "-").toLowerCase();
}
const nameArray = Object.values(name);
console.log(nameArray);
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 fs = require('fs'); | |
fs.readFile(__dirname + '/1426677542365_data.json', function(err, data) { | |
if (err) throw err; | |
var json = JSON.parse(data); | |
console.log('Rows=%d Length=%d', json.length, new Buffer(JSON.stringify(json)).toString('base64').length); | |
}); |
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
require 'json' | |
class JSONSerializer | |
def self.deserialize(json, cls) | |
obj = cls.new() | |
parsed = JSON.parse(json) | |
parsed.each do |child| | |
prop = child[0] | |
value = child[1] | |
obj.send("#{prop}=", 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
it('test', function() { | |
spyOn(dialog, 'dialog').andCallFake(function(opts) { | |
var options = opts.resolve.options(); | |
expect(options.title).toBe('Error'); | |
expect(options.fields[0]).toBe('name'); | |
expect(options.showRequired).toBe(false); | |
// If you look at showError, it calls dialog.dialog | |
// and expects an object returned that has a 'open' method | |
// so mock that out so the real controller does not |
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
it('test', function() { | |
spyOn(dialog, 'dialog').andCallFake(function(opts) { | |
var options = opts.resolve.options(); | |
expect(options.title).toBe('Error'); | |
expect(options.fields[0]).toBe('name'); | |
expect(options.showRequired).toBe(false); | |
// If you look at showError, it calls dialog.dialog | |
// and expects an object returned that has a 'open' method | |
// so mock that out so the real controller does not |
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
'use strict'; | |
angular.module('gigwellApp') | |
/** | |
* Wraps a promise call to provide a "singleton" for that promise so attempts to recreate that promise will simply | |
* reuse the singleton one. | |
* | |
* Supports manually purging and also purging based on a configurable TTL (in ms) | |
*/ | |
.factory('singletonPromise', function($q) { |
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
Index: drupal/sites/all/modules/entityreference/entityreference.module | |
=================================================================== | |
--- drupal/sites/all/modules/entityreference/entityreference.module (revision 2163) | |
+++ drupal/sites/all/modules/entityreference/entityreference.module (working copy) | |
@@ -1030,7 +1030,7 @@ | |
if (isset($tag_last)) { | |
// Get an array of matching entities. | |
- $entity_labels = $handler->getReferencableEntities($tag_last, $instance['widget']['settings']['match_operator'], 10); | |
+ $entity_labels = $handler->getReferencableEntities($tag_last, $instance['widget']['settings']['match_operator'], 20); |