Skip to content

Instantly share code, notes, and snippets.

Avatar
🍑
be sweet

Suyan suyanhanx

🍑
be sweet
View GitHub Profile
@suyanhanx
suyanhanx / pre-receive.go
Created Oct 28, 2018
a commit message check
View pre-receive.go
package main
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"regexp"
"strings"
)
@suyanhanx
suyanhanx / eslint-pushed-changes.sh
Created Oct 20, 2018 — forked from stalniy/eslint-pushed-changes.sh
ESLINT + pre-receive git hook
View eslint-pushed-changes.sh
#!/bin/bash
TEMPDIR=`mktemp -d`
ESLINTRC=$TEMPDIR/.eslintrc
COMMAND="eslint --color -c $ESLINTRC --rule 'import/no-unresolved: 0' --rule 'import/no-duplicates: 0' --rule 'import/export: 0'"
git show HEAD:.eslintrc > $ESLINTRC
echo "### Ensure changes follow our code style... ####"
# See https://www.kernel.org/pub/software/scm/git/docs/githooks.html#pre-receive
@suyanhanx
suyanhanx / eslint-pushed-changes.sh
Created Oct 20, 2018 — forked from stalniy/eslint-pushed-changes.sh
ESLINT + pre-receive git hook
View eslint-pushed-changes.sh
#!/bin/bash
TEMPDIR=`mktemp -d`
ESLINTRC=$TEMPDIR/.eslintrc
COMMAND="eslint --color -c $ESLINTRC --rule 'import/no-unresolved: 0' --rule 'import/no-duplicates: 0' --rule 'import/export: 0'"
git show HEAD:.eslintrc > $ESLINTRC
echo "### Ensure changes follow our code style... ####"
# See https://www.kernel.org/pub/software/scm/git/docs/githooks.html#pre-receive
@suyanhanx
suyanhanx / goyd.go
Last active Aug 2, 2018
a youdao cli (fork from sofish/goyd) 有道翻译命令行工具(英文)
View goyd.go
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
"os/exec"
"strings"