ad = {
'insights': {
'outbound_clicks': [
{
'value': 1.0
}
]
}
This file contains 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
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. |
This file contains 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 re | |
import string | |
import emoji | |
from zhon import hanzi | |
class Filter_Text: | |
def filter_emoji(fun): | |
def wrapper(self, text=''): |
This file contains 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
# 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() |
This file contains 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 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. |
This file contains 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
# 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> |
This file contains 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
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 |
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.
This file contains 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
<?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, |
This file contains 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
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"}; |
NewerOlder