Skip to content

Instantly share code, notes, and snippets.

View newset's full-sized avatar
🐷
Focusing

newset newset

🐷
Focusing
View GitHub Profile
@newset
newset / gist:b729fa29b69964c1a846576829eac50e
Created September 12, 2023 02:42 — forked from YanchaoJia/gist:a23148a58a16923e7fdf923781199084
ubuntu 中文 数据库和gitlog 中文乱码 具体 不显示中文 显示 <E4><B8><B4><E6><97><B6><E4><BF><9D><E5><AD><98>
ubuntu下出现git log 外文正常显示、中文显示乱码的问题。
# 描述:
中文显示位尖括号 <E4><B8><B4><E6><97><B6><E4><BF><9D><E5><AD><98>
# 解决:
$ export LESSCHARSET=utf-8
func transferToken(token string, receiver string) {
ctx := api.Client().StickyContext(context.Background())
w, _ := wallet.FromSeed(api, strings.Split(testnetMnemonic, " "), wallet.V4R2)
log.Println("test wallet:", w.Address().String())
// initialize ton api lite connection wrapper
master := jetton.NewJettonMasterClient(api, address.MustParseAddr(token))
receiverAddress := address.MustParseAddr(receiver)
@newset
newset / .Cloud.md
Created January 11, 2023 01:05 — forked from imba-tjd/.Cloud.md
☁️ 一些免费的云资源

IaaS指提供系统(可以自己选)或者储存空间之类的硬件,软件要自己手动装;PaaS提供语言环境和框架(可以自己选);SaaS只能使用开发好的软件(卖软件本身);BaaS一般类似于非关系数据库,但各家不通用,有时还有一些其它东西。

其他人的集合

@newset
newset / layout.jsx
Last active August 19, 2020 05:05
remax layout plugin - 实现小程序页面自动重新渲染
function withLayout(Component) {
return pros => {
return <Component {...pros} custom='prop' />;
};
}
export {
withLayout
}
@newset
newset / cloudSettings
Last active May 14, 2021 07:29
vscode setting
{"lastUpload":"2021-05-14T07:29:48.859Z","extensionVersion":"v3.4.3"}
# status-bar
set -g status-left-length 32
set -g status-right-length 150
set -g status-fg white
set -g status-bg colour234
set -g window-status-activity-attr bold
set -g pane-border-fg colour245
set -g pane-active-border-fg colour39
set -g message-fg colour16
@newset
newset / increment.js
Created December 6, 2016 04:01
增加版本号方法
function increment (version) {
if (!(version && version.build.match(/^\d+\.\d+\.\d+$/))) {
version = {build: "1.0.0"};
}
var maxVer = 10000;
var ver = version.build.split("."),
current = 2;
while (current > 0 && ver[current]++ >= maxVer) {
@newset
newset / increment-task.js
Created December 6, 2016 03:59
增加版本号任务
/**
* increment build version
* @param {[type]} ){} [description]
* @return {[type]} [description]
*/
gulp.task('increment', function(){
var version = null;
try {
version = require("./version.json");
} catch (e) {
@newset
newset / vimrc
Last active January 15, 2018 15:20
.vimrc
let mapleader = "\<Space>"
set laststatus=2
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
set encoding=utf-8
set t_Co=256
set number
@newset
newset / mysql_period
Created November 27, 2015 01:22
mysql查询上周、月、季度、年和本周、月、季度、年
查询本周记录
select * from ht_invoice_information where WEEKOFYEAR(create_date)=WEEKOFYEAR(NOW());
#查询上周记录
select * from ht_invoice_information where create_date>=date_add(now(),interval -(8 + weekday(now())) day)
and create_date<=date_add(now(),interval -(1 + weekday(now())) day);
#或者
select * from `ht_invoice_information` where WEEKOFYEAR(create_date)=WEEKOFYEAR(DATE_SUB(now(),INTERVAL 1 week));
#查询本月数据
select * from ht_invoice_information where MONTH(create_date)=MONTH(NOW()) and year(create_date)=year(now());