This file contains 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
# golang 编译cgo时需要的环境变量 | |
export LDFLAGS="-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -L/usr/local/homebrew/opt/[email protected]/lib" | |
export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib" # Needed for Rust compilation and linking | |
export CPATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include" | |
export CGO_LDFLAGS="-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks" | |
export CGO_CFLAGS="-F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -Wno-nullability-completeness" | |
export GOROOT="/usr/local/go" | |
export GOBIN=~/go_bin | |
export PATH=$PATH:$GOBIN |
This file contains 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 v10 struct { | |
data [10]byte | |
} | |
//函数参数,指针 | |
//当struct大小在1K时,指针传递(无拷贝)快1个数量级。低于1K差别不大 | |
func BenchmarkPointer10In(b *testing.B) { | |
var v v10 |
This file contains 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
vscode-gist>error: extension.gist.create > Requires authentication |
This file contains 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
//to fix this issue, you can add this to ~/.bashrc: | |
// | |
// export CPATH=`xcrun --show-sdk-path`/usr/include | |
npm ERR! #include <errno.h> | |
~/dev/my/outline-apps[master]$ npm install -g iconv | |
npm ERR! code 1 |
This file contains 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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <assert.h> | |
#include "zlib.h" | |
#define CHUNK 16384 | |
/* | |
40 Length of the zlib stream |
This file contains 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
sphinx: &using | |
address: sphinx-server-host-ip | |
bin_path: /usr/local/bin | |
searchd_binary_name: searchd | |
indexer_binary_name: indexer | |
enable_star: 1 | |
min_prefix_len: 3 | |
prefix_fields: name | |
mem_limit: 1024M | |
morphology: 'none' |
This file contains 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
#@interface中声明变量是否是必须的 | |
@interface Car : NSObject { | |
float p1; //可以删除 | |
float _p2;//可以删除 | |
} | |
@property float p1; | |
@property float p2; |
This file contains 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
require 'hpricot' | |
require 'open-uri' | |
require 'active_support' | |
module Container | |
attr_reader :name, :sub_pages, :elements | |
def subs(name,sub_css,&block) | |
def_sub(name, sub_css, true, &block) | |
end | |
This file contains 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
cmd |