I hereby claim:
- I am geckofu on github.
- I am gallant_matz (https://keybase.io/gallant_matz) on keybase.
- I have a public key ASCCPDu82JdZ4y4hPiRJkEgDSWQFGltE49uutHBn7yckmgo
To claim this, I am signing this object:
dilidili.name | |
acg456.com | |
www.fzdm.com | |
nicotv.me | |
www.nicotv.me##.slide.ff-row.row | |
! 7/13/2020 https://www.bilibili.com | |
www.bilibili.com##.bilibili-player-video-danmaku |
I hereby claim:
To claim this, I am signing this object:
let mapleader = ';' | |
set autoupdategist | |
let scrollstep = 100 | |
let blacklists = ["https://mail.google.com/*", "https://ecs.console.aliyun.com/*", "https://twitter.com/*", "https://www.binance.com/*", "https://sentry.io/*", "https://www.douban.com/*", "https://photos.google.com/*", "https://dev.to/*", "https://lao.sb/*", "https://ace.c9.io/*", "https://feedly.com/*", "https://theplanttokyo.atlassian.net"] |
// Inspired by davej's gist: https://gist.github.com/davej/728b20518632d97eef1e5a13bf0d05c7 | |
// Accepts same arguments as `fetch()`, then returns a promise | |
// - Reject if response is not ok (4xx, 5xx) | |
// - Reject if timeout (by default, a fetch won't timeout) | |
const enhancedFetch = (...args) => { | |
const whinyFetch = fetch(...args) | |
.then((response) => { | |
if (response.ok) { | |
return response |
################# Enumerable Mixin | |
class Account | |
attr_accessor :name, :balance | |
def initialize(name, balance) | |
@name = name | |
@balance = balance | |
end | |
def <=>(other) |
# use the Composite pattern when you are trying to build a hierarchy | |
# three moving parts: base class/interface (component), leaf classes, composite classes | |
class Task | |
attr_reader :name | |
def initialize(name) | |
@name = name | |
end | |
# the user of the strategy -- called the context class -- | |
# can treat the strategies like interchangeable parts. | |
# In addition, because the strategy pattern is based on composition | |
# and delegation, rather than on inheritance, it is easy to switch strategies | |
# at runtime. | |
class PlainTextFormatter | |
def output_report(title, text) | |
puts("**** #{title} ****") |
# Template Method Pattern relies on inheritance | |
class Report | |
def initialize | |
@title = 'Monthly Report' | |
@text = ['Things are going', 'really, really well.'] | |
end | |
def output_report | |
output_start | |
output_head |
# inherite way: | |
# - engine details are probably exposed to the Car | |
# - hard for engine-less vehicle's adaption | |
class Vehicle | |
def start_engine | |
end | |
def stop_engine | |
end | |
end |