#git使用记录 ##1. Config相关:
-
用户名:
git config --global user.name "zhongwencool"
-
用户邮箱
#!/bin/bash | |
# Pull this file down, make it executable and run it with sudo | |
# wget https://raw.github.com/gist/5487621/build-erlang-r16b.sh | |
# chmod u+x build-erlang-r16b.sh | |
# sudo ./build-erlang-r16b.sh | |
if [ $(id -u) != "0" ]; then | |
echo "You must be the superuser to run this script" >&2 | |
exit 1 | |
fi |
#pragma once | |
#include <iostream> | |
#include <windows.h> | |
inline std::ostream& blue(std::ostream &s) | |
{ | |
HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); | |
SetConsoleTextAttribute(hStdout, FOREGROUND_BLUE | |
|FOREGROUND_GREEN|FOREGROUND_INTENSITY); | |
return s; |
%%%------------------------------------------------------------------- | |
%%% @author zhongwencool@gmail.com | |
%%% @doc 一个简单的分层时间轮实现:类似于3维数组实现时钟 | |
%%% 根据 http://www.embeddedlinux.org.cn/RTConforEmbSys/5107final/LiB0071.html 实现 | |
%%% 1.时钟原理说明: | |
%%% 1.1. 初始化一个三层时间轮:秒刻盘:0~59个SecList, 分刻盘:0~59个MinList, 时刻盘:0~12个HourList; | |
%%% 1.2. SecTick由外界推动,每跳一轮(60格),SecTick复位至0,同时MinTick跳1格; | |
%%% 1.3. 同理MinTick每跳一轮(60格),MinTick复位至0,同时HourTick跳1格; | |
%%% 1.4. 最高层:HourTick跳一轮(12格),HourTick复位至0,一个时间轮完整周期完成. | |
%%% 2.事件原理说明: |
%%%------------------------------------------------------------------- | |
%%% @author <zhongwencool@gmail.com> | |
%%% @doc run : | |
%%% erl -name cloud_server@127.0.0.1 -pa "../ebin/" -setcookie best -run cloud_server start_link | |
%%% erl -name server0@127.0.0.1 -pa "../ebin/" -run deal_book_server -extra server0@127.0.0.1 | |
%%% erl -name server1@127.0.0.1 -pa "../ebin/" -run deal_book_server -extra server1@127.0.0.1 | |
%%% ....... | |
%%% erl -name server9@127.0.0.1 -pa "../ebin/" -run deal_book_server -extra server9@127.0.0.1 | |
%%% Created : 11 Apr 2014 | |
%%%------------------------------------------------------------------- |
#git使用记录 ##1. Config相关:
用户名:
git config --global user.name "zhongwencool"
用户邮箱
%%%------------------------------------------------------------------- | |
%%% @author zhongwencool@gmail.com | |
%%% @copyright (C) 2016, <COMPANY> | |
%%% @doc | |
%%% | |
%%% @end | |
%%% Created : 06. 一月 2016 18:30 | |
%%%------------------------------------------------------------------- | |
-module(hex). |
defmodule Httpoison.GitHub do | |
use HTTPoison.Base | |
def process_url(url) do | |
"https://api.github.com" <> url | |
end | |
def process_request_headers(headers) do | |
Dict.put headers, :"User-Agent", "github-httpoison" | |
end |
-module(test). | |
-compile(export_all). | |
%% API | |
run_all_sorted_sublist(List, Num) -> | |
lists:sublist(lists:sort( | |
fun({_,A,_},{_,B,_}) -> A > B end, | |
List), Num). | |
run_gb_trees(List, Num) -> |
{application,zoo, | |
[{description,"Warm and lovely zoo"}, | |
{vsn,"0.1.0"}, | |
{registered,[]}, | |
{mod,{zoo_app,[]}}, | |
{applications,[kernel,stdlib, sasl]}, | |
{env,[]}, | |
{modules,[zoo_app,zoo_keeper,zoo_sup]}]}. |
-module(mnesia_read_test). | |
-include_lib("stdlib/include/ms_transform.hrl"). | |
-include_lib("stdlib/include/qlc.hrl"). | |
%% API | |
-compile(export_all). | |
-record(person, {name, sex, age, height}). | |
-define(PERSON, person). |