New syntax for pipeline and step
1 | - pipeline: |
Custom plugin variables should be placed under settings
1 | kind: pipeline |
1 | - pipeline: |
settings
1 | kind: pipeline |
1 | git clone --recursive <repo_url> |
1 | git submodule init |
1 | git submodule add <submodule_clone_url> <submodule_folder> |
Step1 - Remove submodule folder
1 | git rm --cached /path/to/submodule |
Step2 - Remove submodule config in .gitmodules
1 | -[submodule "themes/next"] |
Step1 - Checkout the target version of the submodule
1 | # Go to the submodule folder |
Step2 - Commit the update
1 | # Back to the parent folder |
Google Tag Manager(GTM) is a back office for quickly managing HTML on webpages, basically, it enables the maintainer to do Everything on their website without changing the code base. There are three major elements in GTM which are Tag, Variable, and Trigger.
A Tag will be triggered by the Trigger you set and passing both the system defined variables and the user-defined variables to your Tag, then you could take the action such as sending it to GA or manipulate DOM on your pages.
Other than System defined variables, you could create your own by Javascript:
Select User-Defined Variables
, then select the type Custom Javascript
1 | function() { |
XAMPP is the most popular PHP development environment including a great GUI - phpMyAdmin, I would like to connect it to a cloud MySQL DB - Google Cloud Platform MySQL.
Recently I start to use Macbook Pro for software development. It is really painful that so many shortcut and software are different from Windows. I hope log it down could help some MAC new comers :)
brew install <program name>
or brew install --cask <program with GUI>
chsh -s $(which zsh)
brew install --cask Karabiner-Elements
shift
brew install --cask scroll-reverser
brew install diff-so-fancy
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"
command + control + shift + 4
(control
is optional for copy to clipboard)command + click
command + backspace
ctrl + command + q
command + w
command + q
ctrl + command + f
command + m
command + tab
to the app, then hold option
then release commandcommand + ,
command + `
command + F3
or (fn) + F11
View
> Show Status Bar
, Show Path Bar
Menu bar
> iterm2
> Make iIerm2 default term
VSCode
To use zsh
, edit user settings:
1 | "terminal.integrated.shell.osx": "zsh", |
Use terminal to open vscode:Command + Shift + P
then Shell Command : Install code in PATH
, then you can type code <folder path>
to open vscode
System Preferences > Notifications
Choose Firefox and uncheck Play sound for notifications
to get rid of the sound.Spotlight
is search engine inside your MacFinder
is File ManagerPreview
has functionality of painter
學徒模式一書的架構是以一篇篇的主題連接起完整的學徒Roadmap,每篇中以情境
問題
解決方案
行動
來引領學徒如我邁向軟體工藝之路,本次再讀此書深覺應身體力行,決定把一些書中提及的的行動實行於部落格內
明天我將顯得更加愚昧,並習慣他。
本篇訴說儘管已經熟悉某些技能並讓他人倚重,但總是會遇到自身所缺的知識,此時勇於放下自尊顯露無知,說不知道,問身邊的專家為什麼才是最快的學習途徑,特別是當你問問題的對象認為你知道問題的答案!
1 | # Remove untracked files |
From wiki-JPEG, we could see a baseline/progressive JPEG have byte marker mapping differently as following:
Short name | Bytes | Payload | Name |
---|---|---|---|
SOF0 | 0xFF, 0xC0 | variable size | Start Of Frame (baseline DCT) |
SOF2 | 0xFF, 0xC2 | variable size | Start Of Frame (progressive DCT) |
So to tell the image is progressive JPEG, we need to check if it contains 0xFF, 0xC0
which is c2ff
in Two-byte hexadecimal display
.
To measure gzip sizing for a request, you don’t need to actually gzip it, just use pipe |
to pipe the stream from curl
to gzip
to wc
:
1 | # before gzip |
As you can see, before gzip it’s 57847 bytes, after gzip it’s 10443 bytes.
You could do same things to measure a file gzip sizing by gzip with -c
option, so it won’t actually gzip it.
1 | $ gzip -c foo.jpg | wc -c |