Posts

Showing posts from June, 2017

Basic Windows 7 shortcuts

For website browsing, I recommend chrome and Vimium. Normally, these shortcuts you'll often use in Vimium: Show help: ? Scroll down: j Scroll up: k Scroll to the top of the page: gg Scroll to the bottom of the page: G Focus the first text input on the page: gi Do not focus on the input box: ESC Open URL, bookmark or history entry in a new tab: O Open a bookmark in a new tab: B Go one tab left: J Go one tab right: K Close current tab: x Restore closed tab: X Go back in history: H Go forward in history: L Copy the current URL to the clipboard: yy Open the clipboard's URL in a new tab: P Then comes windows controlling: Switch between open programs: ALT + TAB Quit program: ALT + F4 Closes the current Multiple Document Interface (MDI) window: CTRL + F4 Change the window size: Windows Logo + Up or Down arrow Change the window location: Windows Logo + Left or Right arrow Minimizes all open windows and displays the desktop: Windows Logo + D M

The meaning of geek

Over the past few months. I have been thinking the meaning of geek. The key to be a geek is: doing things simple and efficient. Simple means maintainable. Efficient means always choice the  better one, saving the time, no matter how difficult it is. It can be used not only programming, but also life. With cooking, washing and so on.

Handle #(hash) by JavaScript

HTML <div style="height: 4000px"></div> <span id='jump_to_this_location'>Jump here!</span> <div style="height: 4000px"></div> <span id='jump_to_the_end'>Jump here!</span> Go to supposed place: window.location.hash = "jump_to_this_location"; Get current URL and characters after #(hash): var url = window.location.href; var hash = url.substring(url.indexOf("#") + 1); alert(hash); Change current hash and go to that place: window.location.hash = 'jump_to_the_end';

Basic git commands

Clone a repository to local git clone *.git Push local files to remote git add . git commit -m "what u wanna say" git push origin Force pull remote files to local git fetch --all git reset --hard origin git pull origin

Review in 2015 and 2016

You may wander what I have learned during 2015 and 2016. Let's count one by one: 1. reading list Introducing Python Mastering Python Regular Expressions 2. third-party packages that I used Requests Flask BeautifulSoup4 Django Selenium Kivy 3. what I can do on internet? Using Requests and BeautifulSoup4 or Selenium do some crawling. Using Flask or Django build websites. Using Kivy write UI, which means Linux, Windows, OS X, Android and iOS APP. 4. what I can do in real life? Talking with you. To do 2017: 1. At least solve 100 algorithm problems during this year 2. Insist learning on Khan Academy everyday 3. Learn JavaScript for web design 4. Maintain github project with vim

Basic terminal shortcuts

Repeat the last command: Ctrl + p Search command in history: Ctrl + r Cancel running activities: Ctrl + c Move forward: Alt + f Move back: Alt + b Move to the start of line: Ctrl + a Move to the end of line: Ctrl + e Clear the screen. Ctrl + l

Basic vim commands

Core commands To insert before the cursor: i To insert after the cursor: a To insert before the line: I To append at the end of line: A Copy a line: yy Delete or cut a line: dd Delete and edit current line: cc Paste a line: pp Create a new line: o Undo: u Save file: ZZ Not save file: ZQ Move commands Up: k Down: j Left: h Right: l Move forward by a word: w Move backward by a word: b To the beginning of file: gg To the end of file: G Indentation Indent current line: >> Unindent current line: << Indent multi lines: >3 + space Unindent multi lines: <3 + space Selecting and Deletion command VGx or Vggx More Go to the definition of current function: gd Go to the documentation of current function or module: shift + k

I firmly Believe

I firmly believe, I will success. 我坚信,我会成功 I firmly believe, I will make it. 我坚信,我会有为 I strongly believe, any hardships can’t make me stop. 我坚信,任何磨难都不能使我退却 I firmly believe, all the efforts will get paid in the end. 我坚信,所有的付出将在最后得到回报 I firmly believe, success belongs to few people. 我坚信,成功者只是少数 I truly believe, the world has its own rules. 我坚信,世间有永恒的真理 I firmly believe, I believe. 我坚信,我坚信

终章 黄粱一梦

你好, 我叫英少。我正向新同学介绍我自己,so shame, 想起恍若昨日发生的一切,似乎有点迷乱。但看看四周,很好,我又回到现实了。 Wow, good. 我不是大神,也没混过黑道,更不清楚 AI 是什么东西。好吧,normal life.

第一章 外星来客

紧张的期末考来了,我对考试 already 麻木了,反正怎么考都是个倒数,在别人心急如焚答着题,或想尽办法作弊时,我却趴在那里 sleeping。 考试 time 眨眼间过去了,我的成绩 have a little 进步,排在了 the 57名,倒数第5了。 Then 就是 correct 试卷了,接着开散学典礼,我高一的学习生活 in this way over。收拾好东西,几件衣服和一条薄毯,慢悠悠的骑着辆2手自行车回到了我乡下的小屋。对我来说, 放假和不放假都差不多,一样的混日子,一样是我自个儿过。 夜深人静,我趴在窗台上,望着遥不可及的星, with 月亮半遮半掩的躲在云里。 前后左右的房子都熄了灯,望着 the outside 一片黑压压的村庄,突然 find 自己是那么的孤独,那么的与这个世界格格不入,我找不到活着的意义。这个世界没有人值得我眷恋,也不会有人眷恋我,这种感觉是那么的可怜。举目无亲,就是我这种吧, even one friend haven't !也对,谁会跟我这样的人做朋友? 再次抬头 look through the 有点悲凉的夜空,发现这个夜空好像有什么地方不同,东边多了一颗与众不同的星星,那颗星比其他的亮了好多。啊??还会动?我脑袋有点短路,这颗星星还真是奇怪啊,居然会移动。流星吗?我马上否决了这个想法,流星移动的速度可比这个快多了。 When 我乱猜时,那颗星星突然一闪,然后出现在了我头上的夜空中。还是那样亮,不过呆的地方却不一样了。 I can't help 目瞪口呆,这也太夸张了吧。UFO??我有点怀疑的擦了擦眼睛,再看,晕啊,没看花啊! 突然,有股吸力拉着我飞上天去,我心一紧,不要吧,外星人要抓我去研究了, suddenly, 我脑袋浮出了这样一张 picture,我被绑在手术床上,几个奇形怪状的外星人围着我。我一阵恶寒,脑袋也在这时候一阵眩晕。Before 昏迷,最后一个念头就是这下完了。 在我昏迷过去后,我的身体也凭空消失在窗台,那颗很亮的星也消失了, out of the sky,好像从来没出现过似的。 ——分割—— 不知过了多久,我迷迷糊糊的醒来,睁开眼睛, find out that 自己躺在一张奇怪的床上,四周都是一些奇怪的仪器,我突然 remembered 我