Skip to content

Instantly share code, notes, and snippets.

View elfgzp's full-sized avatar
☸️
working and learning

Elf elfgzp

☸️
working and learning
View GitHub Profile
@elfgzp
elfgzp / 📊 Weekly development breakdown
Last active October 8, 2022 02:26 — forked from YouEclipse/📊 Weekly development breakdown
📊 Weekly development breakdown
Still Gathering Statistics...
#!/bin/bash
kubectl label namespace default istio-injection=enabled
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}')
export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].nodePort}')
export INGRESS_HOST=$(kubectl get po -l istio=ingressgateway -n istio-system -o jsonpath='{.items[0].status.hostIP}')
export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT
list=`wget -qO- https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt|awk NF|sed ":a;N;s/\n/,/g;ta"`
if [ -z "`grep "bt-tracker" /root/.aria2/aria2.conf`" ]; then
sed -i '$a bt-tracker='${list} /root/.aria2/aria2.conf
echo add......
else
sed -i "s@bt-tracker.*@bt-tracker=$list@g" /root/.aria2/aria2.conf
echo update......
fi
#=============================================================================
# dark_powered.toml --- dark powered configuration example for SpaceVim
# Copyright (c) 2016-2017 Wang Shidong & Contributors
# Author: Wang Shidong < wsdjeg at 163.com >
# URL: https://spacevim.org
# License: GPLv3
#=============================================================================
# All SpaceVim option below [option] section
[options]
# -*- coding: utf-8 -*-
__author__ = 'gzp'
from django.core.management import call_command
from django.db import DEFAULT_DB_ALIAS, connections, transaction
from django.test.testcases import TransactionTestCase
class TestCase(TransactionTestCase):
"""
@elfgzp
elfgzp / ant
Created January 23, 2019 07:48
default.less
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
@import '../color/colors';
// The prefix to use on all css classes from ant.
@ant-prefix : ant;
// -------- Colors -----------
@primary-color : @blue-6;
@info-color : @blue-6;
@success-color : @green-6;
module.exports = {
/** 区分打包环境与开发环境
* process.env.NODE_ENV==='production' (打包环境)
* process.env.NODE_ENV==='development' (开发环境)
* baseUrl: process.env.NODE_ENV==='production'?"https://cdn.didabisai.com/front/":'front/',
*/
// 基本路径
baseUrl: '/',
// 输出文件目录
outputDir: 'dist',
@elfgzp
elfgzp / leetcode_tree.py
Last active February 13, 2019 15:03
use to generate leetcode tree用于生成 leetcode 题目中的树 用于测试
# -*- coding: utf-8 -*-
__author__ = 'gzp'
import json
from copy import copy
class ListNode(object):
def __init__(self, x):
class TestCase(TransactionTestCase):
"""
Similar to TransactionTestCase, but use `transaction.atomic()` to achieve
test isolation.
In most situations, TestCase should be preferred to TransactionTestCase as
it allows faster execution. However, there are some situations where using
TransactionTestCase might be necessary (e.g. testing some transactional
behavior).
@elfgzp
elfgzp / VuePahoMqtt.js
Created December 20, 2018 01:28
👻Vue.js Mqtt client
/*******************************************************************************
* Copyright (c) 2013 IBM Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompany this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at