Skip to content

Instantly share code, notes, and snippets.

Avatar

Evan Lin kkdai

View GitHub Profile
View exe_macho
Magic = 64-bit MachO
Type = Exec
CPU = Amd64, x86_64
Commands = 13 (Size: 2560)
Flags = None
000: LC_SEGMENT_64 sz=0x00000000 off=0x00000000-0x00000000 addr=0x000000000-0x001000000 ---/--- __PAGEZERO
001: LC_SEGMENT_64 sz=0x00718000 off=0x00000000-0x00718000 addr=0x001000000-0x001718000 r-x/rwx __TEXT
sz=0x003d2f6a off=0x00001000-0x003d3f6a addr=0x001001000-0x0013d3f6a __TEXT.__text PureInstructions|SomeInstructions
sz=0x0000029a off=0x003d3f80-0x003d421a addr=0x0013d3f80-0x0013d421a __TEXT.__symbol_stub1 PureInstructions|SomeInstructions (SymbolStubs)
sz=0x0016d980 off=0x003d4220-0x00541ba0 addr=0x0013d4220-0x001541ba0 __TEXT.__rodata
View mach.go
package main
import (
"fmt"
"os"
"github.com/blacktop/go-macho"
)
func main() {
View trello.go
package main
import (
"fmt"
"os"
"github.com/adlio/trello"
)
func main() {
View goreleaser_build.yml
# .goreleaser.yml
builds:
# You can have multiple builds defined as a yaml list
-
# ID of the build.
# Defaults to the project name.
id: "my-build"
# Path to project's (sub)directory containing Go code.
# This is the working directory for the Go build command(s).
View roreleaser-file.xml
uses: goreleaser/goreleaser-action@master
with:
version: latest
args: release -f .goreleaser.yml --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
View go_releaser_cmd_folder.xml
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
@kkdai
kkdai / goreleaser.yml
Created May 26, 2021
Put this file in .github/workflow/goreleaser.yml
View goreleaser.yml
name: goreleaser
on:
pull_request:
push:
permissions:
contents: write
jobs:
View github_issue.go
//CreateIssue :
func (b *CommentClient) CreateIssue(i *Issue) error {
ctx := context.Background()
ts := oauth2.StaticTokenSource(
&oauth2.Token{AccessToken: b.Token},
)
tc := oauth2.NewClient(ctx, ts)
client := github.NewClient(tc)
commentBody := fmt.Sprintf("# %s \n \n \n [%s](%s)", i.ArticleTitle, i.ArticleLink, i.ArticleLink)
View map_issue.go
d.impData = make(map[string]Issue)
for _, c := range d.GetAllComments() {
a := articleMap[c.ArticleLink.ID]
shortLink := getShortPath(a.GetArticleLink())
if issue, exist := d.impData[shortLink]; !exist {
//not exist, insert new issue.
ii := Issue{
ArticleTitle: a.Title,
ArticleLink: a.Link,
ShortLink: shortLink,
View sort_comment.go
type ByCreateAt []IssueComment
func (a ByCreateAt) Len() int { return len(a) }
func (a ByCreateAt) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a ByCreateAt) Less(i, j int) bool { return a[i].CreatedAt.Before(a[j].CreatedAt) }
type IssueComment struct {
Author string
CreatedAt time.Time
Body string