在本篇文档里,我们会使用 mruby 来作为编程语言演示如何在 CKB 实现一个最基础 UDT (User Defined Token) 合约
首先我们需要启动一个本地的开发链来方便调试
我们先用 ckb-cli 命令生成一个新账户用于挖矿,运行 ckb-cli,然后输入
account new
# Turn on Notifications | |
do shell script "defaults -currentHost write com.apple.notificationcenterui doNotDisturb -bool FALSE; defaults -currentHost delete com.apple.notificationcenterui doNotDisturbDate; osascript -e 'quit application \"NotificationCenter\" ' && killall usernoted" -- this set 'Do not disturb' to false in the pref | |
# Show Desktop | |
do shell script "defaults write com.apple.finder CreateDesktop -bool true; killall Finder" | |
# Show all windows | |
tell application "System Events" | |
set visible of (every process) to true | |
end tell |
def timeit(function): | |
'''Decorator used for debugging. Prints the call and how long it took.''' | |
def timed(*args, **kwargs): | |
ts = time.time() | |
result = function(*args, **kwargs) | |
te = time.time() | |
print("{0} ({1}, {2}) {3:.2} sec" | |
.format(function.__name__, args, kwargs, te - ts)) |
if ($http_user_agent ~* (360Spider|80legs.com|Abonti|AcoonBot|Acunetix|adbeat_bot|AddThis.com|adidxbot|ADmantX|AhrefsBot|AngloINFO|Antelope|Applebot|BaiduSpider|BeetleBot|billigerbot|binlar|bitlybot|BlackWidow|BLP_bbot|BoardReader|Bolt\ 0|BOT\ for\ JCE|Bot\ mailto\:craftbot@yahoo\.com|casper|CazoodleBot|CCBot|checkprivacy|ChinaClaw|chromeframe|Clerkbot|Cliqzbot|clshttp|CommonCrawler|comodo|CPython|crawler4j|Crawlera|CRAZYWEBCRAWLER|Curious|Curl|Custo|CWS_proxy|Default\ Browser\ 0|diavol|DigExt|Digincore|DIIbot|discobot|DISCo|DoCoMo|DotBot|Download\ Demon|DTS.Agent|EasouSpider|eCatch|ecxi|EirGrabber|Elmer|EmailCollector|EmailSiphon|EmailWolf|Exabot|ExaleadCloudView|ExpertSearchSpider|ExpertSearch|Express\ WebPictures|ExtractorPro|extract|EyeNetIE|Ezooms|F2S|FastSeek|feedfinder|FeedlyBot|FHscan|finbot|Flamingo_SearchEngine|FlappyBot|FlashGet|flicky|Flipboard|g00g1e|Genieo|genieo|GetRight|GetWeb\!|GigablastOpenSource|GozaikBot|Go\!Zilla|Go\-Ahead\-Got\-It|GrabNet|grab|Grafula|GrapeshotCrawler|GTB5|GT\:\:WWW|Guzz |
package main | |
import ( | |
"time" | |
"regexp" | |
"bufio" | |
"strconv" | |
"fmt" | |
"os" | |
"errors" |
# WeChat aud file converter to wav files | |
# Dependencies: | |
# SILK audio codec decoder (available at https://github.com/gaozehua/SILKCodec) | |
# ffmpeg | |
# | |
# By Gabriel B. Nunes ([email protected]) | |
# Adapted from another script by Nicodemo Gawronski ([email protected]) | |
# | |
import os, argparse, subprocess |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
Sometimes when working with Git you'd like to commit binary files.
But those files won't have clean comparisons with Git standard diff
command.
Fortunately Git is a great tool that comes with a lot of possibilities…
If, as a developer, you are under company constraints and must use MS Office,
you'll encounter some issues when trying to diff MS Office files.
Maybe you're asking yourself: what's the problem with that?
package main | |
import ( | |
"database/sql" | |
"fmt" | |
"net/url" | |
"os" | |
"reflect" | |
"regexp" | |
"strconv" |