Skip to content

Instantly share code, notes, and snippets.

Suncle Chen Flowsnow

Block or report user

Report or block Flowsnow

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Flowsnow
Flowsnow / bank_account.erl
Created Aug 30, 2018
erlang gen_server bank_account
View bank_account.erl
%%%-------------------------------------------------------------------
%%% @author Suncle
%%% @copyright (C) 2017, <COMPANY>
%%% @doc
%%% @end
%%% Created : 13. 十一月 2017 17:19
%%%-------------------------------------------------------------------
-module(bank_account).
-author("Suncle").
-behaviour(gen_server).
@Flowsnow
Flowsnow / bank.erl
Created Aug 30, 2018
erlang bank example
View bank.erl
-module(bank).
-export([start/1,
init/1,
withdraw/1, %% 取款
deposit/1, %% 存款
print/0 %% 打印帐号信息
]).
start(Money) ->
%% spawn,开启进程,并注册进程名为当前模块名
erlang:spawn(?MODULE,init,[Money]).
@Flowsnow
Flowsnow / print_server.erl
Created Aug 30, 2018
erlang print_server
View print_server.erl
%%%-------------------------------------------------------------------
%%% @author Suncle
%%% @doc
%%% print_server
%%% @end
%%% Created : 2017/12/18 14:53
%%%-------------------------------------------------------------------
-module(print_server).
-author("Suncle").
@Flowsnow
Flowsnow / print_server.go
Created Aug 30, 2018
go csp channel print_server
View print_server.go
package main
import (
"fmt"
"time"
)
func main() {
c := make(chan string)
go print(c)
@Flowsnow
Flowsnow / wordpress_post.py
Created Dec 13, 2017
使用python和wordpress_xmlrpc发布wordpress带特征图片的文章
View wordpress_post.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import re
import datetime
import os
import time
@Flowsnow
Flowsnow / getTimeOClock.py
Created Dec 13, 2017
1、获取当天0点的时间戳 2、获取指定时间戳所在天0点的时间戳
View getTimeOClock.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import re
import datetime
import os
import time
@Flowsnow
Flowsnow / sheet_merge.vb
Created Dec 13, 2017
将多个Excel workbook的同名称sheet页(比如sheet也名称为"其他流动资产")合并到一个workbook中
View sheet_merge.vb
Sub HB()
'定义对话框变量
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
'新建一个工作簿
Dim newwb As Workbook
Set newwb = ThisWorkbook
@Flowsnow
Flowsnow / dets.erl
Created Nov 30, 2017
Erlang dets的使用:增删查遍历
View dets.erl
Eshell V7.3 (abort with ^G)
1> dets:open_file(bbb, [{type, bag}]).
{ok,bbb}
2> dets:lookup(bbb, "b11").
[{"b11","b22","b32"},{"b11","b21","b31"}]
3>
3> dets:lookup(bbb, "a11").
[]
4>
4> dets:insert(bbb, {"b11", "b23", "b33"}).
@Flowsnow
Flowsnow / curlPOST.md
Created Nov 16, 2017
curl post请求
View curlPOST.md

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@Flowsnow
Flowsnow / bank_account.erl
Last active Nov 13, 2017
erlang gen_server的使用:以银行账户服务为例
View bank_account.erl
%%%-------------------------------------------------------------------
%%% @author Flowsnow
%%% @copyright (C) 2017, <COMPANY>
%%% @doc
%%% http://www.kongqingquan.com/archives/403
%%% @end
%%% Created : 13. 十一月 2017 17:19
%%%-------------------------------------------------------------------
-module(bank_account).
-author("Flowsnow").
You can’t perform that action at this time.