Skip to content

Instantly share code, notes, and snippets.

rock & roll

daoleno daoleno

rock & roll
View GitHub Profile
daoleno / homebrew
Last active Aug 14, 2020
homebrew 国内源
View homebrew
git -C "$(brew --repo)" remote set-url origin
git -C "$(brew --repo homebrew/core)" remote set-url origin
git -C "$(brew --repo homebrew/cask)" remote set-url origin
brew update
daoleno /
Created Nov 12, 2019
reload-browser - A cross-platform wrapper for reloading the current
# reload-browser - A cross-platform wrapper for reloading the current
# browser tab
# Eric Radman, 2014
usage() {
case `uname` in
# applescript needs the exact title
Client sends HTTP request → Nginx chooses the appropriate handler based on the location config → (if applicable) load-balancer picks a backend server → Handler does its thing and passes each output buffer to the first filter → First filter passes the output to the second filter → second to third → third to fourth → etc. → Final response sent to client


Emiller’s Guide To Nginx Module Development

daoleno /
Last active Aug 12, 2018
some regex




daoleno /
Created May 20, 2018
What is Event Sourcing?
  • Events to provide a history
  • Aggregates to represent the current state of the application
  • Calculator to update the state of the application
  • Reactors to trigger side effects as events happen


daoleno /
Created May 14, 2018
What happens before main() function is executed in C.
  • The hardware is initialized. The most important part of this step is setting up the clock that the CPU needs to run the code. This is usually done by programming a PLL (essentially a programmable clock). If there is not clock going to the CPU, the CPU is essentially dead. The other part of hardware initialization is initializing the interrupt handling hardware.
  • Memory segments are initialized. Memory segments such as .bss (for uninitialized data), .data (for initialized data such as static variables, global variables, local static variables, addresses of functions, and function pointers), and .text (where the actual code resides) are initialized and a valid stack is set up.
  • Command line arguments are received. This may not be relevant in embedded systems as in embedded systems we don’t usually call main() with arguments
  • The stack pointer is configured. This is necessary because the program needs to know where to start from.
  1. Implementing the main feature first
  2. Writing the test afterwards
  3. Running the test to see it succeed
  4. Commenting out critical parts of the feature code
  5. Running the test to see it fail
  6. Uncommenting feature code to its original state
  7. Running the test to see it succeed again
  8. Commiting the code


> telnet 25
Connected to (
Escape character is '^]'. ESMTP Exim 4.66 #1 Wed, 09 May 2007 23:55:12 +0200
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
> EHLO Hello  []