披星戴月的想你
告五人乐队
像森林般围绕着你我
消极的笑痛快的哭
生命真的很难形容
没有人是一座孤岛
可以自全。
每个人都是大陆的一片,
整体的一部分。
如果海水冲掉一片,
欧洲就减少,
如同一个海岬失掉一角,
如果你的朋友或者你自己的领地失掉一块:
任何人的死亡都是我的损失,
因为我是人类的一员,
因此
不要问丧钟为谁而鸣,
它就为你而鸣。
Recently, I was reading bleach comics from the internet.
But when I read those comics, I realise the image loading is relatively slow due to the internet connectivity. So I was considering if I can write any scripts to save images locally for quick reading.
For this task, I applied scrapy
python spider framework for crawling automation. However, most of comics are using lazy loading technology, which utilizes JavaScript code to load images. For lazy loading, the images can not be loaded only from html static context. There are two potential solutions to handle this trouble:
In this post, we start to explore the magic of emacs: customized configuration files for emacs. The magic feature of emacs is the extensibility. Comparing to Vim, which is the specialist as a editor. Emacs is more like an single thread operating system which runs as an editor. In order to explore the magic, we start from the basic extended configurations for the emacs.
Normally, emacs configuration files locate in directory ~/.emacs.d
or ~/.emacs
. The help information for Minor mode
and Major mode
can be explored by pressing key C-h m
.
M-x package-list-packages
lists all the packages can be installed.Sevearl packages I installed in my personal emacs configuration file: auto-complete
Here is my initial configuration file for emacs:
|
|
This will be extended in the future study.
Emacs lisp is a dialect of Lisp language family used for script language in Emacs. For the pragraming process, it has similar machanism with lisp or mit-scheme (another dialect of Lisp). Since emacs lisp (Elisp for short) functions as a script language inside Emacs, it is necessary to learn Elisp for deeper understanding of Emacs and further hacking purpose.
Inside the emacs, the lisp repl can be invoked by switching to *scratch* buffer. (C-x b
searches for the specific buffer. Default buffer will be *scratch*)
While interacting with Elisp, we can use C-x C-e
or C-j
to compile our procedure.
A useful reference provides more details and basic knowledge about Elisp.
Reverse polish notation is used for number calculations in Elisp:
|
|
setq
is used to create a new variable. insert
is able to insert the string.
|
|
Here, when we input C-x C-e
, the lisp will insert string Hello Yang
in the following of the insert
command.
|
|
defun
can define a new function in the Elisp.
|
|
switch-to-buffer-other-window
is used to create a new window with specific buffer.
|
|
progn
combines multiple expressions into one expression.
|
|
let
binds a value to a local variable.
|
|
format
is able to format a string with given format formula:
|
|
Of course, there are some interative commands like read-from-minibuffer
:
|
|
In this post, it just summaries the basic opeartions from the link mentioned in the first paragraph. More functions or data-structure operations can be discovered in the future code reading.
I used to be a vim user for terminal coding. Not really a heavy user since I utilise Intellij for java development. But recently, I read the book called Structure and Interpretation of Computer Programs which explains the program in the deep level with Lisp
. The path of Lisp
learning arouses my interest Emacs, which provides EmacsLisp
for functionality extension. As all we know, the Emacs is characterized by its extensibility.
Emacs stands for “the extensible, customizable, self-documenting, real-time display editor”. In order to try its special magic, the first step is to get familiar with its shortcuts.
Here is the summary for the common shortcuts listed in the emacs tutorial in Emacs (can be invoked by C-h t
). A useful command is called C-h c
+ command to console the usage of the specific command. (For more detailed information, please use C-h k
instead of C-h c
)
C: stands for
Control
key. M: stands forEsc
key.
Note, my development environment is based on mac laptop. M is replaced forAlt
key on Windows computer.
Key | Description |
---|---|
C-v |
Move forward one screenful |
M-v |
Move backward one screenful |
C-l |
Clear screen and redisplay all the text, moving the text around the cursor to the centre of the screen |
C-p |
Move to previous line |
C-n |
Move to next line |
C-b |
Move backward |
C-f |
Move forward |
M-b |
Move backward a word |
M-f |
Move forward a word |
C-a |
Move to the beginning of the line |
C-e |
Move to the tail of the line |
M-a |
Move to the beginnning of the sentence |
M-e |
Move to the tail of the sentence |
M-< |
Move to the beginning of the file |
M-> |
Move to the end of the file |
C-u + number + Operation |
Move forward/backward with specific number of lines/words/letters |
C-u
is valid for any opeartions. Even for character inputs. i.e.C-u
8 will insert 8 in the editor.
Many opeartons starts with
C-x
. Most of them are related with windows, files, buffers opeartions.The bottom line is called minibuffer.
Key | Description |
---|---|
C-g |
Discard commands |
C-x + C-c |
Exit Emacs |
C-x <number> |
Create some windows (i.e. kill all other windows) |
C-x C-f |
Find a file |
C-x C-s |
Save the file |
M-x make-frame |
Create a new frame |
M-x delete-frame |
Delete the selected frame |
Emacs stores all file text into a object called buffer
Key | Description |
---|---|
C-x C-b |
List buffers |
C-x b <BufferName> |
Switch to specific buffer with buffer name |
C-x s |
Save some buffers |
C-z |
Suspend Emacs temporarily |
C-x o |
Switch to the other windows |
C-x k |
Kill the current buffer |
M-C-v |
Scroll the window in the other buffer |
Key | Description |
---|---|
<Delback> |
Delete the character before the cursor |
C-d |
Delete the character afte rthe cursor |
M-<Delback> |
Delete the word befor the cursor |
M-d |
Delete next word after the c |
C-k |
Kill from the cursor position to the end of the line |
M-k |
Kill to the end of current sentence |
C-@ /C-<SPC> C-w |
Kill the context between the two positions |
C-y |
Yank back the killed text. Reinset last killed text |
M-y |
Yank the previous killed text. |
C-/ / C-x u |
Undo previous with one/several command(s) |
M-x repl s<TAB> |
Replace one string with another in the buffer |
M-x recover-file |
Recover files from crashed computer |
M-x fundamental-mode |
Switch back to fundamental mode |
C-x f |
Set the width of margin |
C-s |
Search forward |
C-r |
Search backward |
In increment search mode, use
C-s
and<DEL>
to move back / forward for matched results.
Welcome to My personal blog! This is literally my first post on my first blog. I am going to introduce how I build this blog.
Two major tools are used:
In your site/Hexo repo directory, download NexT theme.
|
|
Configure NexT theme in Hexo directory. Apply NexT theme in _config.xml
configuration file in root directory.
|
|
You can change different schemes based on your personal perference in
_config.xml
in theme directory. For example,scheme: Pisces
can be applied in_config.xml
file if you want to apply pisces scheme.
Learn how to develop and publish Github Pages in Github.
Generate static files and deploy your blog website to Github page.
Configure deploy options in configuration file in root directory and use the following command.
|
|
Some other things like tag page or 404 page can also be set manually by following the official hexo guide.