Date : 2017/08/30.
- Create GitHub account.
- Generate SSH key.
ssh-keygen -t rsa -b 4096 -C "name@xxx.com" -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, |
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=''): |
#!/bin/bash | |
local_path='Your local path' # ex: /home/your_projects/test | |
remote_path='Your cloud path' # ex: /var/www/api | |
remote_con='Your ssh connection' # ex: user@192.168.1.1 | |
# Get the content in 'src/', because I only need to upload the content of 'src/' folder. | |
for file in $(git status --porcelain | grep "src/") | |
do | |
file_name=${file/'^M$'/} # Get to a Modified file. | |
local_file="$local_path$file_name" | |
remote_file="$remote_path$file_name" |