Skip to content

Instantly share code, notes, and snippets.

View rosskevin's full-sized avatar

Kevin Ross rosskevin

View GitHub Profile
@rosskevin
rosskevin / cert-manager.log
Last active November 6, 2018 21:54
not-ready
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 October 31, 2018 18:35
ks show with omit
#!/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 = {
@rosskevin
rosskevin / material-ui-pickers.esm
Created October 17, 2018 13:48
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 October 9, 2018 14:52
swarm services wait for start
#!/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 / Query.tsx
Created September 26, 2018 19:32
Internal wrapper around react-apollo query
import findQueryName from '@alienfast/common/apollo/findQueryName'
import Logger from '@alienfast/common/Logger'
import * as React from 'react'
import { ErrorInfo } from 'react'
import {
OperationVariables,
Query as ApolloQuery,
QueryProps as ApolloQueryProps,
QueryResult,
} from 'react-apollo'
@rosskevin
rosskevin / createStyled.ts
Created September 24, 2018 19:13
createStyled typescript
import {
StyledComponentProps,
StyleRules,
StyleRulesCallback,
WithStyles,
} from '@material-ui/core/styles'
import withStyles, { WithStylesOptions } from '@material-ui/core/styles/withStyles'
import * as React from 'react'
import { PropInjector } from "@material-ui/core";
@rosskevin
rosskevin / relay.js
Last active June 27, 2018 01:07
flow libdef for relay modern 1.2. This is in a _works for me_ state. Someone please export these properly from relay or create a proper flow-typed libdef.
// @flow
declare module 'react-relay' {
declare export type RecordState = 'EXISTENT' | 'NONEXISTENT' | 'UNKNOWN';
declare export type onCompleted = (response: ?Object, errors: ?Array<PayloadError>) => void
declare export type onError = (error: Error) => void
declare export type CommitOptions = {
onCompleted: onCompleted,
@rosskevin
rosskevin / StripeCardsSection.js
Created March 29, 2018 21:18 — forked from lfalke/StripeCardsSection.js
Usage of react-stripe-elements with Material UI (v1.0) styling
import React, { PureComponent } from 'react'
import Grid from 'material-ui/Grid'
import { CardNumberElement, CardExpiryElement, CardCVCElement } from 'react-stripe-elements'
import StripeElementWrapper from './StripeElementWrapper'
export default class extends PureComponent {
static displayName = 'StripeCardsSection'
@rosskevin
rosskevin / db.rake
Last active March 6, 2018 05:02
My db.rake with multi-environment db:rebuild and db:truncate. Some strange behavior in ActiveRecord `database_tasks.rb` adds to the confusion. See this StackOverflow post in the comment.
namespace :db do
# Rake::Task['db:load_config'].enhance [:environment]
desc 'Truncate all tables'
task :truncate => :environment do
puts 'Truncating: '
ActiveRecord::Base.connection.tables.each do |table|
unless %w(schema_migrations rails_admin_histories).include? table
import * as React from 'react'
import * as classNames from 'classnames'
import { StandardProps } from '@alienfast/material-ui'
import { withStyles } from '@alienfast/material-ui/styles'
import Text from '../Text'
import Logger from '../util/Logger'
const decorate = withStyles(
({ palette, shadows, transitions }) => ({
root: {