If encountering DNS resolution when clients are connected to a tailscale enabled gl.inet travel router, check that "Block Non-VPN Traffic" is disabled under VPN Dashboard -> VPN Client -> Global Options
SQL compilation error
when running
labelsnow.put_tables_into_snowflake(ctx, labelbox_payload)
Cause: Missing permissions to create table. Ensure write access to database, schema, warehouse.
"Could not parse partial schema as AST."
Ran into this when using rover to parse a graphql schema that had a syntax error. The issue was caused by double quotes in a graphql comment, something allowed by the framework I was using to render the schema (DGS).
"""Placing quotes around "strings" in graphql comments causes this error"""" # INVALID
The fix is to remove or replace the double quotes, e.g.
This file contains hidden or 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 amazonlinux | |
# epel-release required for graphicsmagick | |
RUN amazon-linux-extras install epel | |
RUN yum -y --nogpgcheck install gcc-c++ make GraphicsMagick yum-utils rpmdevtools | |
# node.js 12 (also adds npm) | |
RUN curl -sL https://rpm.nodesource.com/setup_12.x | bash - | |
RUN yum -y --nogpgcheck install nodejs |
This file contains hidden or 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
const http = require('http'); | |
return new Promise((resolve, reject) => { | |
http.get(url, (res) => { | |
if (res.statusCode >= 400) { | |
const err = new Error(`${res.statusCode} - ${res.statusMessage}`); | |
err.statusCode = res.statusCode; | |
return reject(err); | |
} | |
return resolve(res); |
This file contains hidden or 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
// there are many json-schema validators available, I prefer ajv | |
let Ajv = require('ajv') | |
let ajv = Ajv({ allErrors:true }) | |
let swagger = require('./docs/my-swagger-definition') | |
// validation middleware | |
let validateSchema = (parameters) => { | |
return (req, res, next) => { | |
let errors = [] | |
parameters.map(param => { |
This file contains hidden or 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
CREATE OR REPLACE FUNCTION | |
public.insert_comment() | |
RETURNS TRIGGER AS | |
$BODY$ | |
DECLARE | |
_start_dt text; | |
_end_dt text; | |
_table_name text; | |
BEGIN | |
IF NEW.id IS NULL THEN |
This file contains hidden or 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 MovieView = Backbone.View.extend({ | |
listTemplate: _.template($("#movieTemplate").html()), | |
editTemplate: _.template($("#movieEditTemplate").html()), | |
initialize: function() { | |
this.model.on('change', this.render, this); | |
this.model.on('destroy', this.remove, this); | |
this.model.on('error', this.invalid, this); | |
}, | |
render: function() { | |
this.$el.html(this.listTemplate(this.model.toJSON())); |