ZenHelper

 

Full Screen your chrome, then leverage ont this plugin for URL box
Enjoying Chrome in Completely Full Screen mode even without omnibox (Zen). Leave the address typing to ZenHelper.

Keyboard Shortcut: 
windows: Ctrl+Shift+L
mac: Cmd+Shift+L


Note: This is still beta stage, new feature WIP.

 

https://chrome.google.com/webstore/detail/zenhelper/npikphdpgaccglekeonladokkfghoeej

The craziness

def create_multipliers():
multipliers = []

for i in range(5):
def multiplier(x):
return i * x
multipliers.append(multiplier)

return multipliers

for multiplier in create_multipliers():
print(multiplier(2))

print(“=========================”)

def create_multipliers_lambda():
return [lambda x : i * x for i in range(5)]

for multiplier in create_multipliers_lambda():
print(multiplier(2))

print(“=========================”)

def create_multipliers_fix():
return [lambda x, i=i : i * x for i in range(5)]

for multiplier in create_multipliers_fix():
print(multiplier(2))
8
8
8
8
8
=========================
8
8
8
8
8
=========================
0
2
4
6
8

status for asynchronous process

it’s not a completely novel requirement to get the status for asynchronous processing, for example, to get the file upload progress, to get the order status, alert for processing failures etc.

IMO, there are mostly two approaches for it,
1.synchronous
whether it’s through REST/GraphQL/Queue/DB/FS, if the client is polling for status, that’s a synchronous call, which kind of patched for the original fire and forget async process.

  1. asynch
    this would still be a patch for the original async process, however, it’s really valid. since it’s a “new” requirement from the client to get the status. instead of polling, which almost removed the merits of the original async call, the client could expose a webhook for the server to post back status asynchronously. as such, even though it’s a patch, it will be patched async, leave both processes fire and forget.

https://stackoverflow.com/questions/54841672/get-status-of-asynchronous-invocationtype-event-aws-lambda-execution/58870421#58870421
https://docs.aws.amazon.com/step-functions/latest/dg/sample-project-job-poller.html

access the parent docker daemon from the container

recently i have a need to build/start/stop some sibling containers (vs docker within docker), the way to do it is to expose a pipelien from the host to the container:

for single container:

docker run -v /var/run/docker.sock:/var/run/docker.sock

for docker compose

services:
container-to-control-other-sibling-containers:
image: xyz
build:
context: .folder/to/the/controller/container/image
ports:
- 5000:5000
volumes:
- ./:/app
- /var/run/docker.sock:/var/run/docker.sock

View at Medium.com

actually the dameon could listen from other host (configuration):
https://docs.docker.com/v17.09/engine/admin/#configure-the-docker-daemon

update dockerfile within docker compose

have encountered some issue with the stale dockerfile. turns out, docker compose actually cache previous builds (this is not stated in the doc).

so to keep it updated, need to run build without cache then bring it up.


docker-compose build --no-cache && docker-compose up

contract first vs code first

history is full of similarity.
this is such a repeat of WSDL2Java vs Java2WSDL debate. personally, it’s nothing black or white, right or wrong, similar to the ORM vs mybatis, it’s just opposite design suitable for individual use cases.

https://blog.mirumee.com/schema-first-graphql-the-road-less-travelled-cf0e50d5ccff

the interesting state of monorepo

it might be true that Google or Facebook has some monorepo alive since more than a decade or two decades ago, however, that doesn’t means it’s the right approach for any new projects to adapt in 2019.

tech has been improving on loose coupling and SoC, which is a design idea since GOF and even earlier. this has continuously generating the benefits from version control, project segregation, building, CI/CD and micro services, which resulted faster and better quality delivery and long term maintenance. I will be surprised if monorepo would flourish in next decade or any near future.

quite interesting to see all those ideas/noises/debates come back and forth though.

View at Medium.com