Skip to content

Instantly share code, notes, and snippets.

Kevin Ross rosskevin

Block or report user

Report or block rosskevin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rosskevin
rosskevin / waitForJob.ts
Created Jul 9, 2019 — forked from lukehoban/waitForJob.ts
Pulumi program which waits on Jobs during a Kubernetes deployment
View waitForJob.ts
import * as pulumi from "@pulumi/pulumi";
import * as k8s from "@pulumi/kubernetes";
import * as k8sOutput from "@pulumi/kubernetes/types/output";
import * as k8sapi from 'kubernetes-client';
const job = new k8s.batch.v1.Job("job", {
spec: {
template: {
spec: {
containers: [{
@rosskevin
rosskevin / browser-rewrite.conf
Last active May 13, 2019
nginx map for outdated or unsupported browser redirect based on browserslist output
View browser-rewrite.conf
# include in the server section of the conf.
# ---------------------------------------------------------------
# If we perform a rewrite on every immediately, images won't be
# displayed, so we have to avoid the rewrite for specific files
# in support of displaying the outdated page.
#
set $browser_unsupported_rewrite do_not_perform;
if ($outdated){
@rosskevin
rosskevin / intercom.ts
Created Apr 9, 2019
jss material-ui hide intercom chat
View intercom.ts
// tslint:disable:object-literal-sort-keys
import { create, StyleSheet } from 'jss'
import { jssPreset } from '@material-ui/core'
const jss = create(jssPreset())
const log = Logger.get('Intercom')
let invisibleSheet: undefined | StyleSheet<string>
@rosskevin
rosskevin / ResponsiveDialog.tsx
Last active Dec 3, 2018
Responsive material-ui dialog
View ResponsiveDialog.tsx
import { ExtendMui } from '@alienfast/ui/styles'
import { default as MuiDialog, DialogProps as MuiDialogProps } from '@material-ui/core/Dialog'
import { createStyles, Theme, withStyles, WithStyles } from '@material-ui/core/styles'
import { keys } from '@material-ui/core/styles/createBreakpoints'
import { Breakpoint } from '@material-ui/core/styles/createBreakpoints'
import withMobileDialog from '@material-ui/core/withMobileDialog'
import { isWidthUp } from '@material-ui/core/withWidth'
import * as React from 'react'
const MobileResponsiveDialog = withMobileDialog<MuiDialogProps>({ breakpoint: 'xs' })(MuiDialog)
@rosskevin
rosskevin / gen
Created Nov 13, 2018
ksonnet setup
View gen
#!/usr/bin/env bash
set -e
MANIFESTS=${BASH_SOURCE%/*}/./environments/$1/manifests
rm -rf ${MANIFESTS} && mkdir ${MANIFESTS}
FILE=${MANIFESTS}/cert-manager.yml
./show "$@" --module cert-manager > ${FILE}
FILE=${MANIFESTS}/certificates.yml
View cert-manager.log
I1106 21:51:54.029492 1 start.go:63] starting cert-manager v0.4.1 (revision ad30555d3aebaafa1524272a44ba80ffcdc01d2f)
I1106 21:51:54.031025 1 controller.go:111] Using the following nameservers for DNS01 checks: [10.31.240.10:53]
I1106 21:51:54.031734 1 server.go:68] Listening on http://0.0.0.0:9402
I1106 21:51:54.032235 1 leaderelection.go:175] attempting to acquire leader lease prod-inf/cert-manager-controller...
I1106 21:52:09.671979 1 leaderelection.go:184] successfully acquired lease prod-inf/cert-manager-controller
I1106 21:52:09.673358 1 controller.go:53] Starting certificates controller
I1106 21:52:09.673485 1 controller.go:53] Starting clusterissuers controller
I1106 21:52:09.673645 1 controller.go:53] Starting ingress-shim controller
I1106 21:52:09.674307 1 controller.go:53] Starting issuers controller
I1106 21:52:09.784039 1 controller.go:138] clusterissuers controller: syncing item 'letsencrypt-staging'
@rosskevin
rosskevin / show.js
Last active Oct 31, 2018
ks show with omit
View show.js
#!/usr/bin/env node
const util = require('util')
const exec = util.promisify(require('child_process').exec)
const args = process.argv.slice(2)
const omitComponentArgsIndexes = []
const omitModuleArgsIndexes = []
const propagateArgs = []
const options = {
View material-ui-pickers.esm
import { __extends, __rest, __assign } from 'tslib';
import { func, oneOfType, object, string, element, arrayOf, bool, node, oneOf, number, instanceOf, any, shape } from 'prop-types';
import { createContext, createElement, Component, forwardRef, Fragment, PureComponent } from 'react';
import MaskedInput from 'react-text-mask';
import Icon from '@material-ui/core/Icon';
import IconButton from '@material-ui/core/IconButton';
import InputAdornment from '@material-ui/core/InputAdornment';
import TextField from '@material-ui/core/TextField';
import Button from '@material-ui/core/Button';
import Dialog from '@material-ui/core/Dialog';
@rosskevin
rosskevin / swarm-services-lib.sh
Created Oct 9, 2018
swarm services wait for start
View swarm-services-lib.sh
#!/usr/bin/env bash
# This function checks if the service is in Running state
check_service_is_running() {
local SERVICE_NAME=$1
local STATE=$(docker service ps --format '{{json .CurrentState}}' $SERVICE_NAME)
if [[ $STATE = \"Running* ]]; then
echo 1
else
echo 0
@rosskevin
rosskevin / Dockerfile
Created Oct 1, 2018
nginx envsubst escape $
View Dockerfile
FROM nginx:alpine
# https://thepracticalsysadmin.com/templated-nginx-configuration-with-bash-and-docker/
ENV LISTEN_PORT=80 \
NGINX_ENV=production \
SERVER_NAME=_ \
RESOLVER=8.8.8.8 \
UPSTREAM_API=api:3000 \
UPSTREAM_API_PROTO=http \
WORKDIR=/www \
You can’t perform that action at this time.