Skip to content

Instantly share code, notes, and snippets.

View uhhc's full-sized avatar
🎯
Focusing

uhhc uhhc

🎯
Focusing
View GitHub Profile
C02W84XMHTD5:ucp iahmad$ kubectl get pods --namespace=kube-system
NAME READY STATUS RESTARTS AGE
coredns-c4cffd6dc-nsd2k 1/1 Running 0 1d
etcd-minikube 1/1 Running 0 1d
kube-addon-manager-minikube 1/1 Running 0 1d
kube-apiserver-minikube 1/1 Running 0 1d
kube-controller-manager-minikube 1/1 Running 0 1d
kube-dns-86f4d74b45-d5njm 3/3 Running 0 1d
kube-proxy-rt45q 1/1 Running 0 1d
@jsmouret
jsmouret / struct.go
Last active June 20, 2024 11:15
Convert map[string]interface{} to a google.protobuf.Struct
package pb
import (
"fmt"
"reflect"
st "github.com/golang/protobuf/ptypes/struct"
)
// ToStruct converts a map[string]interface{} to a ptypes.Struct
@fotock
fotock / nginx.conf
Last active October 19, 2024 02:41 — forked from plentz/nginx.conf
Nginx SSL 安全配置最佳实践.
# 生成 dhparam.pem 文件, 在命令行执行任一方法:
# 方法1: 很慢
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
# 方法2: 较快
# 与方法1无明显区别. 2048位也足够用, 4096更强
openssl dhparam -dsaparam -out /etc/nginx/ssl/dhparam.pem 4096
@n3wtron
n3wtron / converter.go
Created June 28, 2017 09:50
golang: grpc Struct converter fom map and golang struct
package util
import (
protobuf_struct "github.com/golang/protobuf/ptypes/struct"
"errors"
"fmt"
"reflect"
"github.com/fatih/structs"
)
@harlow
harlow / golang_job_queue.md
Last active October 30, 2024 13:27
Job queues in Golang
@plentz
plentz / nginx.conf
Last active November 16, 2024 14:10
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@cloudsben
cloudsben / md-menu.html
Last active June 14, 2023 07:46
markdown menu
<link rel="stylesheet" href="http://yandex.st/highlightjs/6.2/styles/googlecode.min.css">
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="http://yandex.st/highlightjs/6.2/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script type="text/javascript">
$(document).ready(function(){
$("h2,h3,h4,h5,h6").each(function(i,item){
var tag = $(item).get(0).localName;
<?php
$data = (object)array(
"html" => "<foo bar=\"baz\"/> &amp;",
"arabic" => "العربية al-ʿarabiyyah, IPA: [æl ʕɑrɑˈbijjɐ], or عربي ʿarabī",
"hebrew" => "עִבְרִית, Ivrit",
"chinese" => "汉语/漢語 Hanyu; 华语/華語 Huáyǔ; 中文 Zhōngwén",
"korean" => "한국어/조선말",
"japanese" => "日本語 Nihongo",
"umlauts" => "äüöãáàß",
@jwage
jwage / SplClassLoader.php
Last active August 16, 2024 17:36
Add MIT license.
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,