This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(fset 'yes-or-no-p 'y-or-n-p) | |
(add-to-list 'default-frame-alist '(fullscreen . maximized)) | |
(defun set-exec-path-from-shell-PATH () | |
(tool-bar-mode 0) | |
;; (load-theme 'leuven t) | |
(load-theme 'monokai t) | |
(if (eq system-type 'windows-nt) | |
(progn | |
(set-face-attribute 'default nil :height 140) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type str struct { | |
p unsafe.Pointer | |
a int | |
} | |
func mstr(s string) str { | |
ss := *(*[2]uintptr)(unsafe.Pointer(&s)) | |
fmt.Println(ss) | |
return str{ | |
p: unsafe.Pointer(ss[0]), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2015-2019 Brett Vickers. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
// Package etree provides XML services through an Element Tree | |
// abstraction. | |
package xmlwrap | |
import ( | |
"bytes" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
_ "image/png" | |
"log" | |
"net/http" | |
"strconv" | |
) | |
type nodeManager struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
set enc=utf-8 | |
set tenc=utf-8 | |
set fenc=utf-8 | |
set fencs=utf-8,usc-bom | |
set cursorline | |
set autoindent | |
set backspace=indent,eol,start | |
set number | |
set incsearch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"encoding/binary" | |
"io" | |
"io/ioutil" | |
"log" | |
"os/exec" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"io/ioutil" | |
"log" | |
"runtime" | |
"sort" | |
"strings" | |
"time" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stdio.h> | |
int first_zero(uint64_t v) | |
{ | |
if (v == 0xffffffffffffffffl) return -1; | |
int bits = 64; | |
uint8_t h; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func uploadWeibo(fn string) ([]byte, error) { | |
file, err := os.Open(fn) | |
if err != nil { | |
return nil, err | |
} | |
defer file.Close() | |
body := &bytes.Buffer{} | |
writer := multipart.NewWriter(body) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"github.com/PuerkitoBio/goquery" | |
"io" | |
"net/http" | |
"os" | |
"path/filepath" |
NewerOlder