Skip to content

Instantly share code, notes, and snippets.

View mkideal's full-sized avatar

王仕晋 mkideal

View GitHub Profile
@mkideal
mkideal / hello-cli.go
Created April 26, 2016 04:42
simple demo for building command line app with golang
package main
import (
"github.com/mkideal/cli"
)
type argT struct {
Help bool `cli:"h,help" usage:"display help information"`
Name string `cli:"name" usage:"your name" dft:"world"`
Age uint8 `cli:"a,age" usage:"your age" dft:"100"`
@mkideal
mkideal / demo-httpd.go
Created April 26, 2016 05:54
demo http server written by golang with mkideal/cli
package main
import (
"fmt"
"net/http"
"github.com/mkideal/cli"
)
type argT struct {
@mkideal
mkideal / terminal.go
Last active May 7, 2020 09:04
demo terminal app
package xyz
import (
"io"
"os"
"golang.org/x/crypto/ssh/terminal"
)
type readerWriter struct {
io.Reader
@mkideal
mkideal / tr-plugin.js
Created May 7, 2016 05:47
google_translate_element
<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'zh-CN', includedLanguages: 'de,en,fr,ja,ko,ru,zh-TW', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, multilanguagePage: true}, 'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
@mkideal
mkideal / ABC.cpp
Created July 28, 2016 13:02
topcoder: ABC
#include <string>
#include <cmath>
#include <set>
using namespace std;
class ABC {
public:
string createString(int N, int K) {
if (K == 0) {
return string(N, 'A');