Skip to content

Instantly share code, notes, and snippets.

View shendongming's full-sized avatar
💭
I may be slow to respond.

sdm2345 shendongming

💭
I may be slow to respond.
View GitHub Profile
@shendongming
shendongming / sh
Last active October 30, 2020 13:29
helm-tls alias
#!/usr/bin/env bash
function helm-tls() {
flag=""
if [[ "$1" == "delete" ]] || [[ "$1" == "diff" ]] || [[ "$1" == "get" ]] || [[ "$1" == "history" ]] || [[ "$1" == "install" ]] || [[ "$1" == "list" ]] || [[ "$1" == "reset" ]] || [[ "$1" == "rollback" ]] || [[ "$1" == "status" ]] || [[ "$1" == "test" ]] || [[ "$1" == "upgrade" ]] || [[ "$1" == "version" ]]; then
flag="--tls"
fi
helm ${1+"$@"} $flag
}
@shendongming
shendongming / proxy.go
Last active August 29, 2015 14:07 — forked from vmihailenco/proxy.go
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
(function() {
var time=9500
var doc = window.document.querySelector('iframe.app_canvas_frame').contentDocument;
var all = doc.querySelectorAll('a[class="del del_btn author_display"]')
console.log(all.length)
if(all.length==0){
setTimeout(function(){location=location},time);
return
}
for (var i = 0; i < all.length; i++) {
<?
/**
* 优先级任务管理
* Class Muti_Task
*/
class Muti_Task {
public $queue = array();
@shendongming
shendongming / arr_avg.js
Created May 16, 2013 14:39
split_array
/*
有两个数组a,b,大小都为n,数组元素的值任意整形数,无序;
要求:通过交换a,b中的元素,使[数组a元素的和]与[数组b元素的和]之间的差最小。
*/
function split_arr(arr1, arr2) {
var diff, diff2, t, v,min_diff;
console.log('init')
var fs = require('fs'),
util = require('util'),
Stream = require('stream').Stream;
/**
* Create a bandwidth limited stream
*
* This is a read+writeable stream that can limit how fast it
* is written onto by emitting pause and resume events to
* maintain a specified bandwidth limit, that limit can
We couldn’t find that file to show.
html test
html
@shendongming
shendongming / ie7
Last active December 16, 2015 05:39
ie7
<meta http-equiv="X-UA-Compatible" content="IE=7" />