Skip to content

Instantly share code, notes, and snippets.

@craigbeck
craigbeck / introspection-query.graphql
Created April 6, 2016 20:20
Introspection query for GraphQL
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
@craigbeck
craigbeck / gx470-resources.md
Last active September 25, 2021 14:50
Lexus GX470 notes
@craigbeck
craigbeck / cv-axle-replacement.md
Created June 10, 2017 21:03
Lexus GX470/4Runner CV axle replacement

Tools 1 21mm socket 1 19mm socket 1 17mm socket 1 35mm socket 1 10mm hex head socket BFH (big effing hammer) Also a rubber mallet is a plus...or just hit the old axle with the big one as it's coming out anyways. 1 short prybar (12 inches) 1 long prybar (36 inches)

@craigbeck
craigbeck / problem.md
Created June 4, 2015 22:40
Fix hapi.js issue with BadRequest when parsing invalid cookie value

Problem

  • multple apps sharing the same cookie domain
  • one app (express.js) is using a secure cookie express:sess and express:sess.sig
  • the hapi.js app tries to parse these cookies and fails returning 400 BadRequest error to client

I don't want hapi to return an error response to the client just because it gets a cookie it cant parse and doesn't care about. I tried setting

server.config({
https://codepen.io/Premisedata/collab/d12f89c524d6945a72de94f28651699c
@craigbeck
craigbeck / profileMiddleware.js
Created March 30, 2019 00:27
redux profile middleware
const profileMiddleware = _ => {
console.log('%cINSTALLED profileMiddleware', 'color:magenta');
return next => action => {
if (typeof action.then === 'function') {
return next(action);
}
// eslint-disable-next-line no-console
console.group('dispatch ' + action.type);
console.time(action.type);
const result = next(action);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@craigbeck
craigbeck / number-formats.js
Created June 3, 2015 17:24
google-libphonenumber examples
var libphonenumber = require("google-libphonenumber");
var formats = libphonenumber.PhoneNumberFormat;
var phoneUtil = libphonenumber.phoneUtil;
var number = phoneUtil.parse("2065557823", "us"); // pass number and country code
// some formats
phoneUtil.format(number, formats.E164);
// '+12065551234`
@craigbeck
craigbeck / cors-example.java
Created July 10, 2014 23:43
Enable cross origin requests (CORS) using the Jersey CrossOriginFilter to Dropwizard 0.7.1
// in run method of your application:
final FilterRegistration.Dynamic cors = environment.servlets().addFilter("crossOriginRequsts", CrossOriginFilter.class);
cors.addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*");
@craigbeck
craigbeck / ORV-resources.md
Last active February 11, 2017 07:47
Off-Road resources