Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View gusibi's full-sized avatar
🎯
Focusing

gusibi gusibi

🎯
Focusing
View GitHub Profile
@gusibi
gusibi / skipLinkedList.go
Created March 15, 2019 07:08
skipLinkedList
package main
import (
"fmt"
"math"
"math/rand"
// "time"
)
/*
@gusibi
gusibi / package_and_deploy_lambda_function.sh
Created January 19, 2018 04:39 — forked from mikeblum/package_and_deploy_lambda_function.sh
Deploy Python Lambda fucntions to AWS
#!/bin/bash
# expects the lambda function .py file to be in the same directory as this script.
# based off of Amazon's official documentation:
# http://docs.aws.amazon.com/lambda/latest/dg/with-s3-example-deployment-pkg.html#with-s3-example-deployment-pkg-python
# get the lambda function
lambda_func_file=$1
lambda_func="${lambda_func_file%.*}"
# exit if no file specified
[[ -z "$1" ]] && { echo "Lambda function is empty" ; exit 1; }
# generate a deployment timestamp
@gusibi
gusibi / python-design-patter-command.py
Last active January 9, 2018 02:01
python设计模式-命令模式
#! -*- coding: utf-8 -*-
"""
命令模式
"""
class Command(object):
def execute(self):
@gusibi
gusibi / python-design-patter-command.py
Created January 9, 2018 02:01
python设计模式-命令模式
#! -*- coding: utf-8 -*-
"""
命令模式
"""
class Command(object):
def execute(self):
@gusibi
gusibi / python-design-patter-builder.py
Created November 12, 2017 08:29
add python-design-patter-builder
#! -*- coding: utf-8 -*-
"""
建造者模式
"""
import time
STEP_DELAY = 0.1
@gusibi
gusibi / python-design-patter-abstract-factory.py
Last active October 28, 2017 13:36
python设计模式-抽象工厂模式
#! -*- coding: utf-8 -*-
"""
抽象工厂模式
"""
# 原料
class FreshClams:
@gusibi
gusibi / python-design-patter-factory-method.py
Created October 28, 2017 08:43
python 设计模式-工厂方法模式
#! -*- coding: utf-8 -*-
"""
工厂方法模式
"""
class Pizza:
name = None
@gusibi
gusibi / python-design-patter-observer.py
Last active December 11, 2019 02:56
python-design-patter-observer.py
#! -*- coding: utf-8 -*-
import itertools
'''
观察者模式实现
'''
class Publisher: