Skip to content

Instantly share code, notes, and snippets.

View RealDeanZhao's full-sized avatar
🤒
Out sick

Dean Zhao RealDeanZhao

🤒
Out sick
View GitHub Profile
@RealDeanZhao
RealDeanZhao / use-sawtooth-sdk-go-on-mac.md
Created August 6, 2018 08:23
Use sawtooth-sdk-go on Mac.md

get sawtooth-sdk-go

go get -u github.com/hyperledger/sawtooth-sdk-go

change gen.sh

From:

sed -i "s|\"protobuf/|\"${repourl}/protobuf/|" "$file"

To:

@RealDeanZhao
RealDeanZhao / main.go
Created June 12, 2018 14:41
go file to install chaincode
package chainmgmt
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/hyperledger/fabric-sdk-go/pkg/client/msp"
"github.com/hyperledger/fabric-sdk-go/pkg/client/resmgmt"
"github.com/hyperledger/fabric-sdk-go/pkg/fab/ccpackager/gopackager"
"github.com/hyperledger/fabric-sdk-go/pkg/fabsdk"
@RealDeanZhao
RealDeanZhao / network-config.yaml
Last active November 29, 2018 10:57
network-config.yaml
---
name: "xyd-themis"
x-type: "hlfv1"
description: "Themis Network"
version: "1.0"
client:
organization: xiaoyudian
logging:
@RealDeanZhao
RealDeanZhao / docker-compose.yaml
Last active June 12, 2018 10:24
docker-compose.yaml
version: '2'
networks:
xyd-themis:
services:
rca-themis:
container_name: rca-themis
image: hyperledger/fabric-ca:x86_64-1.1.0
@RealDeanZhao
RealDeanZhao / docker-compose.yaml
Last active June 7, 2018 09:45
docker-compose.yaml
version: '2'
networks:
xyd-themis:
services:
rca-themis:
container_name: rca-themis
image: hyperledger/fabric-ca:x86_64-1.1.0
@RealDeanZhao
RealDeanZhao / .babelrc
Created August 2, 2017 09:29 — forked from c9s/.babelrc
webpack + babel + typescript + es6 - total solutions!
{
"presets": ["es2015"],
"plugins": ["transform-runtime"]
}
@RealDeanZhao
RealDeanZhao / autowire-resttemplate.md
Last active May 23, 2023 07:45
How to autowire RestTemplate using annotations

From StackOverflow

Errors you'll see if a RestTemplate isn't defined

Consider defining a bean of type 'org.springframework.web.client.RestTemplate' in your configuration.

or

No qualifying bean of type

@RealDeanZhao
RealDeanZhao / git-undo-commit-and-redo.md
Last active April 12, 2017 08:38
git undo a commit and redo
$ git commit -m "Something terribly misguided"              (1)
$ git reset HEAD~                                           (2)
<< edit files as necessary >>                               (3)
$ git add ...                                               (4)
$ git commit -c ORIG_HEAD                                   (5)
  1. This is what you want to undo
@RealDeanZhao
RealDeanZhao / parse-inputstream-to-jsonobject.md
Created April 10, 2017 06:00
Parse InputStream to JsonObject
JsonObject json;
  try {
    JsonElement element = new JsonParser().parse(
    new InputStreamReader(responseEntity.getBody().getInputStream())
  );
  json = element.getAsJsonObject();
} catch (IOException e) {
  throw new RuntimeException(e.getLocalizedMessage());
}
@RealDeanZhao
RealDeanZhao / filter-ignore-specific-url.java
Created March 31, 2017 08:45
Ignore the specific url in a fitler
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
final HttpServletRequest httpRequest = (HttpServletRequest) request;
final HttpServletResponse httpResponse = (HttpServletResponse) response;
final String path = ((HttpServletRequest) request).getRequestURI();
if (path.startsWith("/api/v1/oauth")) {
chain.doFilter(request, response);
} else {
chain.doFilter(request, response);
}