Skip to content

Instantly share code, notes, and snippets.

Passionate programmer


Passionate programmer
View GitHub Profile
jianwu /
Last active June 19, 2019 18:26
A typical component in DI every approach
public class OderSericeImpl implement OrderService {
private final ShoppingCartService cartService;
private final PricingService pricingService;
private final InventoryService inventoryService;
private final UserSession userSession;
private final TimeProvider timeProvider;
// ... and many more, this list will keep increasing when more requirements added
public OrderService(
ShoppingCartService cartService,
jianwu / mshell
Last active October 27, 2021 12:50
mshell: to run jshell for a maven project with all the dependancies injected.
View mshell
# Run this script from the maven module directory to start a jshell with
# all dependent class paths injected.
# Please never run it on the parent maven project directory.
# It depends on java9 or above
if [ ! -d "target" ]; then
echo "Please run it under a module directory. And make sure it's not parent module directory. And make a maven install first"
jianwu / static_server.js
Last active February 9, 2023 22:38 — forked from ryanflorence/static_server.js
Node.JS static file web server, also provides CORSProxy, Http/Https proxy function. Put it in your path to fire up servers in any directory, takes an optional port argument. If provide second https port argument, it will also start https. For https to work, need to put key and cert file in the folder.
View static_server.js
#!/usr/bin/env node
const { argv } = require('process');
Static http server implemented with NodeJS.
1. No external dependencies