Skip to content

Instantly share code, notes, and snippets.

View zhaopan's full-sized avatar

ZP zhaopan

  • CQ·CHINA
  • 12:50 (UTC +08:00)
View GitHub Profile
git_current_branch () {
local ref
ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null)
local ret=$?
if [[ $ret != 0 ]]
then
[[ $ret == 128 ]] && return
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
fi
echo ${ref#refs/heads/}
@damienstanton
damienstanton / generics.go
Created February 20, 2020 20:32
Generics in Go (proposed)
/*
* This code is taken from Ian Lance Taylor's Gophercon 2019 talk on
* a proposed syntax/semantics for generics in Go. As such, it won't
* compile on any released Go compiler as of this posting (early 2020).
*/
// Tree is a generic binary tree
type Tree (type E) struct {
root *node(E)
compare func(E, E) int
@MidasXIV
MidasXIV / conventional_commit_messages.md
Created February 2, 2021 21:03 — forked from qoomon/conventional-commits-cheatsheet.md
Conventional Commit Messages

Conventinal Commit Messages

See how a minor change to your commit message style can make a difference. Examples

Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs

Commit Formats

Default

@shyamvlmna
shyamvlmna / sorting.go
Last active March 1, 2023 12:08
Sorting algorithms in Go (Selection sort, Insertion sort, Bubble sort, Merge sort, Quick sort)
package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
@AhmedAlhallag
AhmedAlhallag / Yelp Project_Scraping_Final.ipynb
Created March 1, 2023 07:19
Desktop/Desktio_2023_Post_S1/DB_Lab1/Yelp Project Scraping_Final.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
set -ex
# 相关技术连接:
# https://github.com/XTLS/Xray-install
# https://github.com/XTLS/Xray-examples
## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
## !不建议关闭操作系统的防火墙,除非你在服务商中配置了防火墙!