Skip to content

Instantly share code, notes, and snippets.

diff --git a/app/mixins/controllers/shared/legacy_urls.rb b/app/mixins/controllers/shared/legacy_urls.rb
index 0a8d96f8fb3..5c2aabe92c3 100644
--- a/app/mixins/controllers/shared/legacy_urls.rb
+++ b/app/mixins/controllers/shared/legacy_urls.rb
@@ -66,8 +66,11 @@ module Mixins::Controllers::Shared::LegacyUrls
# many apologies to my past and future selves!
unless url
if LegacySlug.community_has_legacy_slugs?(current_community)
- if legacy_slug = LegacySlug.for_community_and_slug(current_community, request.path.gsub(/^\//, ""))
+ path = request.path.gsub(/^\//, "")
diff --git a/server/middleware/auth.js b/server/middleware/auth.js
index 7bc58a561..94cb82b7f 100644
--- a/server/middleware/auth.js
+++ b/server/middleware/auth.js
@@ -1,6 +1,7 @@
var express = require('express');
var passport = require('../../shared/passport');
var router = express.Router();
+var crypto = require('crypto');
diff --git a/app/frontend/packs/application.js b/app/frontend/packs/application.js
index b9316e776..6f265a41f 100644
--- a/app/frontend/packs/application.js
+++ b/app/frontend/packs/application.js
@@ -38,9 +38,7 @@ const apolloProvider = new VueApollo({
document.addEventListener('DOMContentLoaded', () => {
console.log(apolloProvider);
new Vue({
- components: { App },
- router,
diff --git a/app/services/slug_change_service.rb b/app/services/slug_change_service.rb
index 590f3915de4..683a8dc3a2e 100644
--- a/app/services/slug_change_service.rb
+++ b/app/services/slug_change_service.rb
@@ -30,7 +30,7 @@ def modify_page_slug!
end
def modify_stack_slug!
- modify_legacy_slug!(@entry.slug)
+ result = modify_legacy_slug!(@entry.slug)
diff --git a/package.json b/package.json
index 975d65d..eded79b 100644
--- a/package.json
+++ b/package.json
@@ -15,7 +15,7 @@
"scripts": {
"prestart": "npm run -s build",
"start": "node -r newrelic dist/index.js",
- "dev": "nodemon src/index.js --exec \"node -r dotenv/config -r babel-register\"",
+ "dev": "nodemon src/index.js --exec \"node --inspect=0.0.0.0:9229 -r dotenv/config -r babel-register\"",
@thomsbg
thomsbg / graphql-result.json
Created June 27, 2018 16:00
EditorCommunity error
{
"data": {
"community": null
},
"errors": [
{
"message": "Expected a value of type \"EntryType\" but received: MAP_STACK",
"locations": [
{
"line": 3,
@thomsbg
thomsbg / permissions.txt
Last active June 6, 2018 18:50
permissions query pseudocode
can user u perform operation o in scope s?
1. scopes = [s].concat(s.parents)
2. roles = RoleAssignment.where(user: u, scope: scopes).pluck(:role)
3. roles.any? { |role| ROLE_OPERATIONS_MAPPING[role].operations.include?(o) }
## or perhaps
1. scopes = [s].concat(s.parents)
diff --git a/app/controllers/graphql_controller.rb b/app/controllers/graphql_controller.rb
index 2e300fc0..02592ea2 100644
--- a/app/controllers/graphql_controller.rb
+++ b/app/controllers/graphql_controller.rb
@@ -9,6 +9,15 @@ def execute
}
result = HermanoGraphQL.schema.execute(query, variables: variables, context: context, operation_name: operation_name)
render json: result
+ rescue StandardError => e
+ e = e.cause while e.cause
@thomsbg
thomsbg / volume.graphql
Last active March 26, 2018 21:05
volume + sbn schema stitching
# in tower:
query {
volumeProjects(communityId: 441, q: "Hillary") {
name # from volume api
contributorIds # from volume api, chorus user ids of the video's "contributors" (not sure if this is a thing, just an example)
contributors {
fullName # from sbn api, able to be efficiently resolved by batching multiple user-by-ids queries.
}
}
entry(id: 1234) {
bylines {
name
url
}
}
# The API knows to fetch from various database sources,
# and returns full names vs usernames according to community rules,
# but leaves the formatting as HTML, and comma-joining up to the client