Date : 2017/08/30.
- Create GitHub account.
- Generate SSH key.
ssh-keygen -t rsa -b 4096 -C "[email protected]" -f github - Look and copy SSH public key.
| function changeStuff(a, b, c) | |
| { | |
| a = a * 10; | |
| b.item = "changed"; | |
| c = {item: "changed"}; | |
| } | |
| var num = 10; | |
| var obj1 = {item: "unchanged"}; | |
| var obj2 = {item: "unchanged"}; |
| <?php | |
| // Some PHP variable | |
| // $compositeArr = [ | |
| // Imagick::COMPOSITE_DEFAULT, | |
| // Imagick::COMPOSITE_UNDEFINED, | |
| // Imagick::COMPOSITE_NO, | |
| // Imagick::COMPOSITE_ADD, | |
| // Imagick::COMPOSITE_ATOP, | |
| // Imagick::COMPOSITE_BLEND, | |
| // Imagick::COMPOSITE_MULTIPLY, |
Date : 2017/08/30.
ssh-keygen -t rsa -b 4096 -C "[email protected]" -f github| from bisect import bisect, insort | |
| # Return the index. | |
| def in_bisect(sorted_list, target_value): | |
| i = bisect(sorted_list, target_value) | |
| return i | |
| # Return the new list. | |
| def insert_by_bisect(sorted_list, target_value): | |
| i = insort(sorted_list, target_value) | |
| return sorted_list |
| # generator expressions | |
| x_iter = (x for x in range(5)) | |
| print(x_iter) | |
| # <generator object <genexpr> at 0x7fd7339355c8> | |
| for x in x_iter: | |
| print(x) | |
| # 0 - 4 | |
| print(next(x_iter)) | |
| # Traceback (most recent call last): File "python", line 5, in <module> |
| import os | |
| import datetime | |
| from datetime import timezone | |
| import boto3 # Import from basic library (base on aws lambda) | |
| """ | |
| os.environ: { | |
| 'aws_access_key_id', <= aws's id. | |
| 'aws_secret_access_key', <= aws's key. | |
| 'retention_days', <= this is a retention. |
| # Basic's getter and setter. | |
| class Car(object): | |
| __wheels = 4 | |
| def get_wheels(self): | |
| return self.__wheels | |
| def set_wheels(self, value=4): | |
| self.__wheels = value | |
| car = Car() |
| import re | |
| import string | |
| import emoji | |
| from zhon import hanzi | |
| class Filter_Text: | |
| def filter_emoji(fun): | |
| def wrapper(self, text=''): |
| FROM lambci/lambda:build-python3.6 | |
| WORKDIR /var/task | |
| ENV WORKDIR /var/task | |
| # Make the dir and to install all packages into packages/ | |
| RUN mkdir -p packages/ && \ | |
| pip install uuid -t packages/ | |
| # Copy initial source codes into container. |