Skip to content

Instantly share code, notes, and snippets.

Avatar

Keith Grennan keeth

View GitHub Profile
@jamiegs
jamiegs / adaptive-ecs-scaling.md
Last active Nov 5, 2019
Description of ECS scaling solution developed for Hudl.
View adaptive-ecs-scaling.md

Adaptive Container Scaling

Problems with AWS's recommended scaling method

  • Based on a fixed percentage of memory and CPU reservation.
  • Scaling on both cpu and memory metrics can cause the metrics to fight with each other where it'll scale out then back in and repeat.
  • If you're scaling threshold is at 80% memory, current reservation utilization is at 79% and you deploy a container that requires 25% memory, It will fail to launch.
  • ASGs are not container aware.

Solution

View auth-with-reach-router.jsx
let UserContext = React.createContext();
class App extends React.Component {
state = {
user: null,
setUser: user => {
this.setState({ user });
}
};
@evantahler
evantahler / buildSitemap.js
Last active Dec 17, 2020
35 lines to build a sitemap for next.js projects
View buildSitemap.js
#! /usr/bin/env node
// I am ./bin/buildSitemap.js
const path = require('path')
const glob = require('glob')
const fs = require('fs')
const SITE_ROOT = process.env.SITE_ROOT || 'https://www.actionherojs.com'
const SOURCE = process.env.SOURCE || path.join(__dirname, '..', 'pages', '/**/*.js')
const DESTINATION = process.env.DESTINATION || path.join(__dirname, '..', 'static', 'sitemap.xml')
@mizchi
mizchi / webpack.config.js
Last active Dec 6, 2019
minimum webpack with babel
View webpack.config.js
/*
yarn init -y
yarn add webpack webpack-cli webpack-serve html-webpack-plugin -D
yarn add babel-loader@^8.0.0-beta @babel/core @babel/preset-env -D
echo '{ "presets": ["@babel/preset-env"] }' > .babelrc
*/
const HtmlPlugin = require("html-webpack-plugin");
module.exports = {
mode: process.env.NODE_ENV || "development",
@knowbody
knowbody / ex-navigation.md
Last active Aug 5, 2021
My exponent's ex-navigation docs/thoughts
View ex-navigation.md

Exponent - ex-navigation

This is for now, for my personal use only, things might not be correctly explained here. For the official docs please check: https://github.com/exponentjs/ex-navigation/blob/master/README.md

Navigation bar configuration

On every screen you can use the built-in navigation bar, you can add a title, left button, right button or change navigation bar’s style. All you need to do is pass appropriate params to navigationBar in the route configuration:

import React, { Component } from 'react';
View gist:4c909b6c54085887daff
fileserver_backend:
- git
gitfs_provider: pygit2
gitfs_remotes:
- git@gitlab.<tld>:it/salt.git:
- privkey: /root/.ssh/id_rsa
- pubkey: /root/.ssh/id_rsa.pub