Skip to content

Instantly share code, notes, and snippets.

@thomsbg
thomsbg / image.js
Created August 23, 2015 22:07
image quill format
{
type: 'embed',
tag: 'IFRAME',
add: function(node, value) {
node.classList.add('image');
node.setAttribute('data-src', value.src);
node.setAttribute('data-caption', value.caption);
node.setAttribute('src', '/iframe/image.html');
return node;
},
@thomsbg
thomsbg / snippet.rb
Created November 19, 2015 00:02
fix_nested_attributes_for_uniqueness.rb
def fix(records, params, matcher)
params = params.deep_dup
records.each do |record|
if p.any? { |attrs| attrs['id'].present? && attrs['id'].to_i == record.id }
next
elsif (new_attrs = p.detect { |attrs| attrs['id'].blank? && attrs[matcher].present? && attrs[matcher].to_i == record[matcher] })
new_attrs['id'] = record.id
else
p << { '_destroy' => true, 'id' => record.id }
@thomsbg
thomsbg / mysql.log
Last active October 21, 2016 00:11
# at 76104583
#161020 20:30:26 server id 211 end_log_pos 76104666 CRC32 0xccbca688 Query thread_id=878921 exec_time=0 error_code=0
SET TIMESTAMP=1476995426/*!*/;
BEGIN
/*!*/;
# at 76104666
#161020 20:30:26 server id 211 end_log_pos 76121710 CRC32 0x27a99c3e Query thread_id=878921 exec_time=0 error_code=0
SET TIMESTAMP=1476995426/*!*/;
update `docs` set `head_version` = '{\"doc_id\":154345,\"user_id\":44,\"delta\":[{\"p\":[\"publish_history\",2],\"li\":{\"date\":\"2016-10-20T20:30:23.628Z\",\"user\":\"David Fucillo\",\"event_type\":\"published\"}}],\"contents\":{\"hed\":{\"ops\":[{\"attributes\":{\"author\":\"44\"},\"insert\":\"Jameis \"},{\"insert\":\"Winston on why he didn’t go to Stanford: “It was really me not really knowing how prestigious Stanford was.”\\n\",\"attributes\":{\"author\":\"1627\"}}]},\"dek\":{\"ops\":[{\"insert\":\"The Tampa Bay Buccaneer\",\"attributes\":{\"author\":\"1627\"}},{\"insert\":\"s\",\"attributes\":{\"author\":\"44\"}},{\"insert\":\" quarterback met with the Bay Area media,
diff --git a/shared/find_each_model.js b/shared/find_each_model.js
index fb575db..bb671c8 100644
--- a/shared/find_each_model.js
+++ b/shared/find_each_model.js
@@ -1,10 +1,12 @@
var Bluebird = require('bluebird');
-module.exports = function findEach(Model, fn, since, success) {
- since = (since == null) ? 0 : since;
+module.exports = function findEach(Model, fn, lastId, success) {
diff --git a/config/schema/rich-text.json b/config/schema/rich-text.json
index 945b771d2..385e33e8a 100644
--- a/config/schema/rich-text.json
+++ b/config/schema/rich-text.json
@@ -88,7 +88,19 @@
"type": "integer"
},
"attributes": {
- "$ref": "#/attributes"
+ "oneOf": [
diff --git a/config/schema/mapstack-v1.json b/config/schema/mapstack-v1.json
index de9e97ff0..4a0d19777 100644
--- a/config/schema/mapstack-v1.json
+++ b/config/schema/mapstack-v1.json
@@ -2,8 +2,10 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "https://chorus.voxmedia.com/schema/mapstack-v1.json",
"type": "object",
+ "additionalProperties": {
+ "$ref": "story-v2.json#"
diff --git a/client/app.js b/client/app.js
index 5086ac0d3..758272d2b 100644
--- a/client/app.js
+++ b/client/app.js
@@ -1,4 +1,5 @@
var Emitter = require('eventemitter2').EventEmitter2;
+var sentryActions = require('./actions/sentry');
var App = window.App = function(opts) {
Emitter.call(this);
diff --git a/client/actions/groups.js b/client/actions/groups.js
index bc8e4f61d..175ce42bc 100644
--- a/client/actions/groups.js
+++ b/client/actions/groups.js
@@ -36,11 +36,11 @@ export function getAllParents(group, groups) {
return [group];
}
-function childrenOf(group, groups) {
- var children = sortBy(compact(group.child_entry_group_ids.map((id) => {
diff --git a/client/components/user-status.html b/client/components/user-status.html
index 75c1c7722..eb37eefca 100644
--- a/client/components/user-status.html
+++ b/client/components/user-status.html
@@ -29,6 +29,35 @@ component.exports = {
newCompose: function() {
return this.get('entitlements').includes('use_new_compose');
},
+ numVisible: function() {
+ var numVisible = 0;
diff --git a/Gemfile b/Gemfile
index 71fe72e..20ea0ff 100644
--- a/Gemfile
+++ b/Gemfile
@@ -7,3 +7,4 @@ gem "unicorn"
gem "thin"
gem "puma"
gem "concurrent-ruby"
+gem "libv8"
diff --git a/Gemfile.lock b/Gemfile.lock