This file contains 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
# typed: true | |
# @prettier | |
require 'sorbet-runtime' | |
# Put this somewhere like lib/rubocop/cop/lint/sorbet_sigil.rb and then | |
# require it in .rubocop.yml: | |
# | |
# require: | |
# - ./lib/rubocop/cop/lint/sorbet_sigil.rb |
This file contains 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
# The MIT License (MIT) | |
# Copyright (c) 2014 Dave Clark | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This file contains 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
# | |
# Reference implementation of a load balanced PgBouncer service on Amazon ECS | |
# | |
# see: https://engineering.loyaltylion.com/load-balanced-pgbouncer-service-on-amazon-ecs-f02120d1733e | |
# | |
resource "aws_lb" "pgbouncer" { | |
name = "${var.environment}-pgbouncer" | |
internal = true | |
load_balancer_type = "network" |
This file contains 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
#!/bin/bash -e | |
## | |
# Use this annotated script a base for launching an interactive console task on Amazon ECS | |
# | |
# more info: https://engineering.loyaltylion.com/running-an-interactive-console-on-amazon-ecs-c692f321b14d | |
# | |
# Requirements: | |
# - `jq` must be installed on both the client and server | |
## |
This file contains 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
-- when you have a record which looks like this | |
-- | |
-- id: 5, | |
-- properties: { | |
-- ages: [20, 30] | |
-- } | |
-- | |
-- it is a bit of a pain if you need to query based on the contents of the "ages" array inside the JSON object "properties" | |
-- because PG currently lacks easy to use operators to work with JSON arrays |
This file contains 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
import { resolve } from 'path' | |
import { GatsbyCreatePages } from './types' | |
const createPages: GatsbyCreatePages = async ({ | |
graphql, | |
boundActionCreators, | |
}) => { | |
const { createPage } = boundActionCreators | |
const allMarkdown = await graphql(` |
This file contains 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 nconf = require('nconf'); | |
var yaml = require('js-yaml'); | |
var app_config = __dirname + '../config/application.yml'; | |
// load cmd line args and environment vars | |
nconf.argv().env(); | |
// load a yaml file using a custom formatter | |
nconf.file({ |
This file contains 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
/** | |
* npm install jsdom | |
* npm install jquery | |
*/ | |
var html = "<!doctype html><html><body><h1>Hello world!</h1></body></html>"; | |
/* parse the html and create a dom window */ | |
var window = require('jsdom').jsdom(html, null, { | |
// standard options: disable loading other assets |
This file contains 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
#!/usr/bin/env ruby | |
require 'datadog/statsd' | |
require 'json' | |
statsd = Datadog::Statsd.new('localhost', 8125) | |
queue_fields = %w( | |
consumer_utilisation | |
consumers |
This file contains 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
line = '127.0.0.1 gateway.internal gateway' | |
file = Chef::Util::FileEdit.new('/etc/hosts') | |
file.insert_line_if_no_match(/#{line}/, line) | |
file.write_file |
NewerOlder