Skip to content

Instantly share code, notes, and snippets.

@dazuiba
dazuiba / bash_path
Last active March 15, 2024 09:21
path
# 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
/**
type v10 struct {
data [10]byte
}
//函数参数,指针
//当struct大小在1K时,指针传递(无拷贝)快1个数量级。低于1K差别不大
func BenchmarkPointer10In(b *testing.B) {
var v v10
vscode-gist>error: extension.gist.create > Requires authentication
//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
@dazuiba
dazuiba / dedict.c
Created July 29, 2016 17:07 — forked from josephg/0dedict.py
Apple dictionaries
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "zlib.h"
#define CHUNK 16384
/*
40 Length of the zlib stream
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'
@dazuiba
dazuiba / xcode cheetsheet
Created September 4, 2010 13:36
objective-c学习笔记
#@interface中声明变量是否是必须的
@interface Car : NSObject {
float p1; //可以删除
float _p2;//可以删除
}
@property float p1;
@property float p2;
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
cmd