Skip to content

Instantly share code, notes, and snippets.

View smallnest's full-sized avatar

smallnest smallnest

View GitHub Profile

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

$(function () {
$(".gq-anwser-btn").click(function () {
$(this).html($(this).html() == "隐藏答案" ? "显示答案" : "隐藏答案").next(".gq-anwser").toggle()
})
$(".gq-run-btn").click(function () {
var $this = $(this), $code, $output
if ($this.prev().is(".output")) {
$output = $this.prev()
$code = $output.prev().find("textarea")
$output.removeClass().addClass("output bs-callout").html("<img src='/assets/compiling.gif' />")
@smallnest
smallnest / openssl.md
Created January 3, 2018 06:09 — forked from alphajc/openssl.md
有关openssl使用,详细的参数参见man手册

生成rsa key

openssl genrsa [-help] [-out filename] [-passout arg] [-aes128] [-aes192] [-aes256] [-camellia128] 
[-camellia192] [-camellia256] [-des] [-des3] [-idea] [-f4] [-3] [-rand file(s)] [-engine id] [numbits]

请求证书

@smallnest
smallnest / openssl.md
Created January 3, 2018 06:09 — forked from alphajc/openssl.md
有关openssl使用,详细的参数参见man手册

生成rsa key

openssl genrsa [-help] [-out filename] [-passout arg] [-aes128] [-aes192] [-aes256] [-camellia128] 
[-camellia192] [-camellia256] [-des] [-des3] [-idea] [-f4] [-3] [-rand file(s)] [-engine id] [numbits]

请求证书

@smallnest
smallnest / go-missing-examples.md
Created January 15, 2018 03:21 — forked from andrestc/go-missing-examples.md
Go std lib funcs/methods missing examples

About this

This list has the goal of helping developers interested in contributing to the Go language but are unsure of where to start. This was not generated manually so some functions and methods here may not require examples (maybe because they are too simple, e.g .String()) and some of these may only make sense in a package level example (which are not considered for this list yet). Use your best judgment and check the documentation before you open up a CL to add an example.

You should also search in gerrit for open CLs that are already adding examples.

I will try to keep this list as up to date as possible. If you find any mistakes, please comment below and I will try to fix it.

func openbrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
@smallnest
smallnest / go-qthtml2pdf.go
Created February 6, 2018 08:26 — forked from MrSaints/go-qthtml2pdf.go
A basic HTML to PDF converter in Golang using Qt WebEngine 5.7. For a more production-ready converter, see: http://www.athenapdf.com/
package main
import (
"flag"
"fmt"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/gui"
"github.com/therecipe/qt/webengine"
"github.com/therecipe/qt/widgets"
"os"
@smallnest
smallnest / generate_go_types.pl
Created March 5, 2018 03:39
Create go types based on mysql schema #tags: lang-go, lang-perl
#!/usr/bin/env perl
use strict;
use Getopt::Long;
use DBI;
use String::CamelCase qw(camelize decamelize wordsplit);
my $type_map = {
bigint => 'int64',
blob => 'string',
package trylock
import (
"sync"
"sync/atomic"
"unsafe"
)
const mutexLocked = 1 << iota
@smallnest
smallnest / README.markdown
Created May 15, 2018 02:30 — forked from FranklinYu/README.markdown
links for old versions of Docker for Mac (inspired by docker/for-mac#1120)

links for old versions of Docker for Mac

Deprecated

Docker provides download links in release note. They promised that

(we) will also include download links in release notes for future releases.

Note: