Skip to content

Instantly share code, notes, and snippets.

@domharrington
domharrington / settings.json
Created March 16, 2023 17:15
VSCode Settings
{
"editor.fontFamily": "Monaco",
"editor.fontSize": 18,
"editor.tabSize": 2,
"editor.wordWrap": "on",
"editor.formatOnPaste": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.snippetSuggestions": "top",
"workbench.colorTheme": "Bluloco Light",
"php.suggest.basic": false,
@domharrington
domharrington / mongoose-middleware-debug-timings.js
Created March 9, 2023 16:31
Mongoose plugin to add debug() timings to all pre/post middlewares
const debug = require('debug');
function debugMiddlewareTimings(schema) {
const vanityNames = {
_pres: 'pre',
_posts: 'post',
};
Object.keys(schema.s.hooks).forEach(hookType => {
schema.s.hooks[hookType].forEach((value, key) => {
value.forEach((hook, i) => {
@domharrington
domharrington / development.rb
Last active March 8, 2023 17:58
Metrics Rails Configuration
require "readme/metrics"
Rails.application.configure do
options = {
api_key: "YOUR KEY HERE",
reject_params: ['data', 'attributes']
}
config.middleware.use Readme::Metrics, options do |env|
{
{
"openapi": "3.0.2",
"info": {
"description": "Create beautiful product and API documentation with our developer friendly platform.",
"version": "2.0.0",
"title": "API Endpoints",
"contact": {
"name": "API Support",
"url": "https://docs.readme.com/docs/contact-support",
"email": "support@readme.io"
@domharrington
domharrington / .gitignore
Last active May 24, 2022 13:21 — forked from duyquach-castr/server-ext.js
HapiJS sample code
node_modules
@domharrington
domharrington / extension.js
Last active September 4, 2018 21:26
Replace `require()` calls with links to npm
// ==UserScript==
// @name Replace `require()` calls with links to npm
// @namespace https://gist.github.com/domharrington
// @version 0.2
// @author @domharrington
// @match https://github.com/*
// @grant none
// ==/UserScript==
(function() {
@domharrington
domharrington / remove-hot-network-questions.js
Created May 4, 2018 15:46
Remove hot network questions from Stack Overflow
// ==UserScript==
// @name Remove hot network questions from Stack Overflow
// @namespace http://tampermonkey.net/
// @version 0.1
// @author You
// @match https://stackoverflow.com/*
// @grant none
// ==/UserScript==
(function() {
@domharrington
domharrington / petstore-swagger.json
Last active January 24, 2021 16:01
petstore with example response json
{
"swagger": "4.0",
"info": {
"description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",
"version": "1.0.0",
"title": "Swagger Petstore",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"email": "apiteam@swagger.io"
},

Keybase proof

I hereby claim:

  • I am domharrington on github.
  • I am domharrington (https://keybase.io/domharrington) on keybase.
  • I have a public key whose fingerprint is CF25 DE0B 4DD2 4B70 0805 9E7B 5661 1886 43C9 AC0D

To claim this, I am signing this object:

@domharrington
domharrington / Adds a delete button to ionic app user device tokens.user.js
Created June 6, 2016 14:50
Adds a delete button to ionic app user device tokens
// ==UserScript==
// @name Adds a delete button to ionic app user device tokens
// @namespace http://tampermonkey.net/
// @version 0.1
// @author Dom Harrington (https://github.com/domharrington)
// @match https://apps.ionic.io/app/*/users/list
// @grant none
// ==/UserScript==
(function() {