This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 目标: 构建中文dsl | |
| Date today | |
| "hello" size | |
| 'hello' executeMethod: ('hello' class lookupSelector: #size) | |
| [:x | Date executeMethod: (Date class lookupSelector:x) ] value: #today |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import itchat, time | |
| from itchat.content import TEXT | |
| @itchat.msg_register([TEXT]) | |
| def text_reply(msg): | |
| # 不会接受群消息 | |
| # msg.user.send('%s: %s' % (msg.type, msg.text)) | |
| # author = itchat.search_friends(nickName='Finn')[0] | |
| # author.send('hi ,我正通过codelab的Scratch界面与你聊天!') | |
| content = msg.text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title>video player</title> | |
| </head> | |
| <body onload="onload();"> | |
| <video | |
| id="idle_video" | |
| onended="onVideoEnded();" | |
| controls="controls" | |
| ></video> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| IoT: Internet of Things | |
| server : iot.codelab.club | |
| # tool: | |
| pip3 install hbmqtt # 0.9.5 | |
| hbmqtt_pub --url mqtt://guest:[email protected] -t "/scratch3_sub" -m "hello from hbmqtt_pub" | |
| hbmqtt_sub --url mqtt://guest:[email protected] -t "/scratch3_pub" | |
| ''' | |
| import logging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # python3 | |
| ''' | |
| usage | |
| 1. download sb3 and unzip | |
| * box2d_2_codelab_start.sb3 | |
| * rename box2d_2_codelab_start.sb3 -> box2d_2_codelab_start.zip | |
| * unzip it: -> box2d_2_codelab_start | |
| 2. Modify content | |
| 3. zip box2d_2_codelab_start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # python3 | |
| ''' | |
| Usage: | |
| openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
| python3 simple_https_server.py | |
| ''' | |
| import http.server, ssl | |
| server_address = ('localhost', 8601) | |
| httpd = http.server.HTTPServer(server_address, http.server.SimpleHTTPRequestHandler) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| anim_launch_cubediscovery | |
| anim_slowpoke_loop_04 | |
| anim_dancebeat_quit_01 | |
| anim_observing_sides_area_01 | |
| anim_message_deleted_short_01 | |
| anim_fastbump_loop_01 | |
| anim_hiking_driving_start_04 | |
| anim_cubedocking_drive_loop_01 | |
| anim_hiking_driving_start_03 | |
| anim_launch_wakeup_startdriving_01 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Vector: | |
| https://developer.anki.com/vector/docs/getstarted.html | |
| https://github.com/anki/vector-python-sdk/blob/master/examples/tutorials/02_drive_square.py | |
| todo: | |
| 内置 anki_vector, 是否可行? | |
| ''' | |
| import time | |
| import threading | |
| from scratch3_adapter import settings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| from io import StringIO | |
| import contextlib | |
| @contextlib.contextmanager | |
| def stdoutIO(stdout=None): | |
| old = sys.stdout | |
| if stdout is None: | |
| stdout = StringIO() | |
| sys.stdout = stdout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ➜ ~ cookiecutter https://github.com/pydanny/cookiecutter-django | |
| You've downloaded /Users/wuwenjie/.cookiecutters/cookiecutter-django before. Is it okay to delete and re-download it? [yes]: yes | |
| project_name [My Awesome Project]: scratch_backend | |
| project_slug [scratch_backend]: | |
| description [Behold My Awesome Project!]: scratch backend | |
| author_name [Daniel Roy Greenfeld]: wwj718 | |
| domain_name [example.com]: backend.codelab.club | |
| email [[email protected]]: [email protected] | |
| version [0.1.0]: | |
| Select open_source_license: |