- 比較Supervisor 和DynamicSupervisor的差異性
- 了解child_spec裡的內容
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
pass |
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
#!/bin/bash | |
current_branch=$(git rev-parse --abbrev-ref HEAD) | |
if [[ ${current_branch} == "master" ]] | |
then | |
echo "pull ${current_branch}" | |
git fetch | |
git pull origin ${current_branch} | |
elif [[ ${current_branch} == "staging" ]] | |
then |
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
; declare a atom var | |
(def x (atom 5)) | |
; get value of atom | |
@x | |
; change atom's value | |
(swap! x inc) | |
; reset |
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 time | |
import wrapt | |
import random | |
import weakref | |
def cache_it(keyfn): | |
cache = weakref.WeakKeyDictionary() | |
@wrapt.decorator |
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 wrapt | |
import logging | |
@wrapt.decorator | |
def trace_it(wrapped, instance, args, kwargs): | |
import time | |
begin_at = time.time() | |
ret = wrapped(*args, **kwargs) |
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 time | |
import wrapt | |
import contextlib | |
import weakref | |
import functools | |
class Cacher: | |
def __init__(self): |
python ariadne usage
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 wrapt | |
@wrapt.decorator | |
def pass_through(wrapped, instance, args, kwargs): | |
print("pass_through", wrapped, instance, args, kwargs) | |
return wrapped(*args, **kwargs) | |
@pass_through | |
def foo(): |
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
from injector import Injector, Key, inject | |
Sizes = Key('sizes') | |
Names = Key('names') | |
class A: | |
@inject | |
def __init__(self, number: int, names: Names, sizes: Sizes): | |
print("init A", [number, names, sizes]) | |
self.number = number |
NewerOlder