kubectl -n kube-system create sa tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
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
class StringedDict(dict): | |
def __setitem__(self, key, value): | |
super().__setitem__(str(key), value) |
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
def connection_for_type(_type): | |
"""Added totalCount node on the Connectionfield""" | |
class Connection(graphene.Connection): | |
total_count = graphene.Int( | |
description="Total count of {}s.".format(_type._meta.name)) | |
class Meta: | |
description = name = _type._meta.name + 'Connection' | |
node = _type |
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
# -*- coding: utf-8 -*- | |
import datetime | |
import graphene | |
from graphene.types.datetime import DateTime | |
class FormattedDateTime(DateTime): | |
""" | |
This is a custom Scalar type. This DateTime Scalar can be formatted into |
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
# -*- coding: utf-8 -*- | |
from inflection import underscore | |
from sqlalchemy import inspect | |
from sqlalchemy.orm import RelationshipProperty, joinedload, load_only | |
class RelationshipPathNode(object): | |
def __init__(self, value, parent=None): | |
if parent: | |
parent.isLeaf = False |
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
# Make mouse useful | |
# Toggle mouse on | |
bind m \ | |
set -g mouse on \;\ | |
display 'Mouse mode: ON' | |
# Toggle mouse off | |
bind M \ | |
set -g mouse off \;\ | |
display 'Mouse mode: OFF' |
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
from celery import Task | |
from flask import has_request_context, make_response, request | |
from myapp import app | |
__all__ = ['RequestContextTask'] | |
class RequestContextTask(Task): |
db.getCollectionNames().map(name => ({totalIndexSize: db.getCollection(name).stats().totalIndexSize, name: name})).sort((a, b) => a.totalIndexSize - b.totalIndexSize).forEach(printjson)
db.serverStatus().tcmalloc.tcmalloc.formattedString
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
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
// Name of the struct tag used in examples | |
const tagName = "validate" |
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
package main | |
import ( | |
"golang.org/x/net/context" | |
"github.com/docker/docker/api/types" | |
"github.com/docker/docker/api/types/container" | |
"github.com/docker/docker/api/types/network" | |
"github.com/docker/docker/cli/command" | |
"github.com/docker/docker/client" | |
"fmt" |