Skip to content

Instantly share code, notes, and snippets.

View elcolie's full-sized avatar

El 李天宝 elcolie

View GitHub Profile
@elcolie
elcolie / q1.py
Created January 9, 2020 07:09
codeware1
sample = {
"name": "green",
"score": 1,
"children": [
{
"name": "house",
"score": 1,
"children": []
},
{
Camilla Martinez 765-296-3642
Amya Hood 469-515-6966
Johnathan Lucas 219-610-0167
Dulce Fitzgerald 273-998-6736
Rey Mccall 623-278-9827
Cameron Mahoney 327-603-8781
Patricia Adkins 741-256-2766
Caitlin Bradford 449-228-9982
Lewis Kennedy 306-901-2985
Frederick Orozco 755-396-7454
1927-12-30 17.660000
1928-01-03 17.760000
1928-01-04 17.719999
1928-01-05 17.549999
1928-01-06 17.660000
1928-01-09 17.500000
1928-01-10 17.370001
1928-01-11 17.350000
1928-01-12 17.469999
1928-01-13 17.580000
NORTH 2
WEST 3
WEST 25
SOUTH 49
NORTH 88
SOUTH 61
SOUTH 12
EAST 43
WEST 25
SOUTH 20
{
"name": "codewars is a ",
"score": 0,
"children": [
{
"name": "gentle",
"score": 2,
"children": [
{
"name": "turn for",

Styling

Python supports many programmer from variety of programming background. Therefore you might found some style adopted from others programming languages

Here are some of style that I recommend everybody follow

  1. print(f"var: {var}"). Use literal string interpolation
  2. logger.info. User Python logger module do not use print
  3. def mtl_request(data: typing.Dict, headers: typing.Dict, endpoint: str = 'DOPA'): Add type hint
  4. Avoid if else use key: value from dict
<html>
<script>
// Utils functions:
function urlBase64ToUint8Array (base64String) {
var padding = '='.repeat((4 - base64String.length % 4) % 4)
var base64 = (base64String + padding)
.replace(/\-/g, '+')
.replace(/_/g, '/')
var rawData = window.atob(base64)
sixteen:~ hellohbot$ helm get ipman
REVISION: 1
RELEASED: Wed Mar 20 18:34:51 2019
CHART: mongodb-replicaset-3.9.2
USER-SUPPLIED VALUES:
affinity: {}
clusterDomain: cluster.local
configmap: null
image:
debug: false
## Global Docker image parameters
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
##
# global:
# imageRegistry: myRegistryName
# imagePullSecrets:
# - myRegistryKeySecretName
image:
@elcolie
elcolie / ingress-rules.yaml
Created March 4, 2019 10:11
ingress rules
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: webapp-ingress
spec:
rules:
# - host: my.kubernetes.example
- host: singh.hbot.io
http:
paths: