Skip to content

Instantly share code, notes, and snippets.

@islishude
islishude / kubernetes-dashboard.yaml
Last active December 9, 2019 09:14
k8s dashboard
apiVersion: v1
kind: Namespace
metadata:
name: kubernetes-dashboard
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
@islishude
islishude / github.go
Created December 2, 2019 06:51
github latest release
package github
import (
"context"
"encoding/json"
"net/http"
)
// Remote remote git server
type Remote struct {

Keybase proof

I hereby claim:

  • I am islishude on github.
  • I am islishude (https://keybase.io/islishude) on keybase.
  • I have a public key ASB18HUq43FGsiHXBcy7JBDk4PAwCp8WLRxPe--noiuWswo

To claim this, I am signing this object:

@islishude
islishude / shamir.go
Created November 7, 2019 05:44
Shamir's Secret Sharing by golang
package main
import (
"crypto/rand"
"fmt"
"reflect"
"github.com/hashicorp/vault/shamir"
)
package hdkey
import (
"errors"
"strconv"
"strings"
"github.com/btcsuite/btcutil/hdkeychain"
)
@islishude
islishude / server_daemon.go
Created October 16, 2019 13:38
golang daemon example
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"path"
@islishude
islishude / gitlab-ci.yml
Created October 8, 2019 09:57
gitlab ci example for golang project
stages:
- test
.testtpl: &test_template
coverage: '/coverage: \d+\.\d+% of statements/'
before_script:
- "apk add ca-certificates git"
script:
- "go test -v -cover ./..."
@islishude
islishude / ecsign.ts
Last active October 9, 2019 00:29
r,s,v for ethereum transaction
// ref: https://github.com/ethereumjs/ethereumjs-util/blob/master/src/signature.ts#L15
const secp256k1 = require('secp256k1')
interface ISignature {
signature: Buffer,
recovery: number,
}
export const ecsign = function(
msgHash: Buffer,
-- BEGIN generate DDL --
DROP DATABASE IF EXISTS ex;
CREATE DATABASE ex;
DROP USER IF EXISTS ex_rw@'%';
pub trait Bird {
fn fly(&self);
}
pub struct Duck;
pub struct Swan;
impl Bird for Duck {
fn fly(&self) {
println!("duck fly");