Skip to content

Instantly share code, notes, and snippets.

Yi Wang wangkuiyi

View GitHub Profile
@wangkuiyi
wangkuiyi / mdfmt.bash
Created Jun 19, 2020
Auto-format Markdown files
View mdfmt.bash
#!/bin/bash
TAB=$(printf '\t')
in_code=0
previous_line=""
while IFS= read -r LINE
do
previous_line=$line
@wangkuiyi
wangkuiyi / clang-format@38.rb
Created Jan 28, 2018
Homebrew formula of clang-format 3.8
View clang-format@38.rb
class ClangFormatAT38 < Formula
desc "Formatting tools for C/C++/ObjC/Java/JavaScript/TypeScript"
homepage "https://clang.llvm.org/docs/ClangFormat.html"
url "https://releases.llvm.org/3.8.0/llvm-3.8.0.src.tar.xz"
sha256 "555b028e9ee0f6445ff8f949ea10e9cd8be0d084840e21fbbe1d31d51fc06e46"
bottle do
cellar :any_skip_relocation
sha256 "239146d2fd9e73963b0c1497df74f091a386f452a2f9276a65fd63c73b27ed63" => :high_sierra
sha256 "5608a169a7b3ceb15253c693e29108acf744a4ab39b5daa51e99fd95f9a8d444" => :sierra
@wangkuiyi
wangkuiyi / learn-mpi.go
Created Dec 18, 2015
Build and run an MPI program in Go
View learn-mpi.go
// This is a sample MPI program in Go.
//
// To build and run it, we need to install MPI. I downloaded and built
// Open MPI 1.8.8:
//
// wget https://www.open-mpi.org/software/ompi/v1.8/downloads/openmpi-1.8.8.tar.bz2
// tar xjf openmpi-1.8.8.tar.bz2
// cd openmpi-1.8.8
// ./configure --prefix=/home/yi/openmpi
// make -j2 install
@wangkuiyi
wangkuiyi / crawl_github_comments.go
Created Feb 2, 2020
This program crawls all code review comments of a GitHub repo
View crawl_github_comments.go
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"os"
"regexp"
"strings"
@wangkuiyi
wangkuiyi / pre-commit-clang-format
Last active Oct 10, 2019
Git pre-commit hook that invokes clang-format to reformat C/C++/Objective-C source code.
View pre-commit-clang-format
#!/bin/bash
# git pre-commit hook that runs an clang-format stylecheck.
# Features:
# - abort commit when commit does not comply with the style guidelines
# - create a patch of the proposed style changes
# modifications for clang-format by rene.milk@wwu.de
# This file is part of a set of unofficial pre-commit hooks available
# at github.
View gist:b3d6383077e94f08185d3b9dfd3f5b64
#!/usr/bin/env python
import tensorflow as tf
class Model(tf.keras.Model):
def __init__(self):
super(Model, self).__init__()
self.W = tf.Variable(5., name='weight')
self.B = tf.Variable(10., name='bias')
@wangkuiyi
wangkuiyi / Dockerfile
Last active Feb 2, 2019
A Dockerfile of Swift 4.2.1 and Go 11.5
View Dockerfile
FROM swift:4.2.1
RUN curl https://dl.google.com/go/go1.11.5.linux-amd64.tar.gz | tar -C /usr/local -xz
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin
@wangkuiyi
wangkuiyi / Dockerfile
Created May 24, 2018
Install and running Google tangent in Docker
View Dockerfile
FROM ubuntu:16.04
RUN apt update
RUN apt install -y python-setuptools python-dev build-essential python-pip
RUN pip install --upgrade pip
RUN pip install tangent==0.1.8
CMD ["/bin/bash"]
View learn-etcd-client.go
// The official etcd Go client library is far from easy-to-use. I had
// to read github.com/coreos/etcd/client and
// github.com/coreos/etcd/etcdctl before I can write down the
View PaddlePaddle-CLA.md

PaddlePaddle Contributor License Agreement

In order to clarify the intellectual property license granted with Contributions from any person or entity, the open source project PaddlePaddle ("PaddlePaddle") must have a Contributor License Agreement (CLA) on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of PaddlePaddle and its users; it does not change your rights to use your own Contributions for any other purpose.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to PaddlePaddle. Except for the license granted herein to PaddlePaddle and recipients of software distributed by PaddlePaddle, You reserve all right, title, and interest in and to Your Contributions.

  1. Definitions. "You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with PaddlePaddle
You can’t perform that action at this time.