Skip to content

Instantly share code, notes, and snippets.

View zchee's full-sized avatar
😩
want to Go knowledge...

Koichi Shiraishi zchee

😩
want to Go knowledge...
View GitHub Profile
@zchee
zchee / go-clang-dump.s
Last active September 12, 2016 15:51
go-clang-dump Plan9 assembly
// +build ignore
"".main t=1 size=2291 args=0x0 locals=0x178
0x0000 00000 (./main.go:18) TEXT "".main(SB), $376-0
0x0000 00000 (./main.go:18) MOVQ (TLS), CX
0x0009 00009 (./main.go:18) LEAQ -248(SP), AX
0x0011 00017 (./main.go:18) CMPQ AX, 16(CX)
0x0015 00021 (./main.go:18) JLS 2281
0x001b 00027 (./main.go:18) SUBQ $376, SP
0x0022 00034 (./main.go:18) MOVQ BP, 368(SP)
package main
import (
"go/ast"
"go/parser"
"go/token"
"strconv"
)
// 实现一个只支持int,只支持加法,函数只有println,只支持一个参数的Go语言子集....
@zchee
zchee / musl-cross.rb
Created July 19, 2016 01:03 — forked from FiloSottile/README.md
Homebrew Formula for musl-based GCC cross-compilers.
class MuslCross < Formula
desc "Linux cross compilers based on musl libc"
homepage "https://github.com/richfelker/musl-cross-make"
head "https://github.com/richfelker/musl-cross-make.git"
bottle do
cellar :any_skip_relocation
end
option "with-arm-hf", "Build cross-compilers targeting arm-linux-musleabihf"
@zchee
zchee / ideviceenterrecovery.c
Created July 18, 2016 18:21
With this tool you can enter in recovery mode easily without adding your udid instead of the initial code from Libimobiledevice
/* gcc ideviceenterrecovery.c -o ideviceenterrecovery -limobiledevice */
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <libimobiledevice/libimobiledevice.h>
#include <libimobiledevice/lockdown.h>
static char *udid = NULL;
int main()
diff --git a/libguile/stime.c b/libguile/stime.c
index f430ca4..8b810a7 100644
--- a/libguile/stime.c
+++ b/libguile/stime.c
@@ -834,6 +834,10 @@ scm_init_stime()
#ifdef HAVE_POSIX_CPUTIME
{
+#ifdef __APPLE__
+ if (clock_gettime (CLOCK_PROCESS_CPUTIME_ID, &posix_run_time_base) == 0)
@zchee
zchee / example.md
Created July 17, 2016 12:23 — forked from ericclemmons/example.md
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 <summary>Summary Goes Here</summary>
package main
import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
This file has been truncated, but you can view the full file.
|DEBUG| START Peco.Run
|DEBUG| START Peco.Setup
|DEBUG| START Peco.SetupSource
|DEBUG| Blocking until we read something in source...
|DEBUG| START Peco.ExecQuery
|DEBUG| peco is not ready yet, ignoring.
|DEBUG| END Peco.ExecQuery (16.087µs)
|DEBUG| START Peco.ExecQuery
|DEBUG| peco is not ready yet, ignoring.
|DEBUG| END Peco.ExecQuery (8.668µs)
0 *ast.File {
1 . Package: /Users/zchee/src/github.com/zchee/nvim-go/src/nvim-go/commands/analyze/buffer.go:1:1
2 . Name: *ast.Ident {
3 . . NamePos: /Users/zchee/src/github.com/zchee/nvim-go/src/nvim-go/commands/analyze/buffer.go:1:9
4 . . Name: "analyze"
5 . }
6 . Decls: []ast.Decl (len = 12) {
7 . . 0: *ast.GenDecl {
8 . . . TokPos: /Users/zchee/src/github.com/zchee/nvim-go/src/nvim-go/commands/analyze/buffer.go:3:1
9 . . . Tok: import
@zchee
zchee / Launch_Alpine_Linux_3.3.x_on_AWS.md
Created June 25, 2016 22:10 — forked from kennwhite/Launch_Alpine_Linux_3.3.x_on_AWS.md
Launch Alpine Linux 3.3.x on Amazon Web Services