Posts

git - the simple guide by Roger Dudler

Image
setup Download git for OSX Download git for Windows Download git for Linux create a new repository create a new directory, open it and perform a git init to create a new git repository. checkout a repository create a working copy of a local repository by running the command git clone /path/to/repository when using a remote server, your command will be git clone username@host:/path/to/repository workflow your local repository consists of three "trees" maintained by git. the first one is your  Working Directory  which holds the actual files. the second one is the  Index  which acts as a staging area and finally the  HEAD  which points to the last commit you've made. add & commit You can propose changes (add it to the  Index ) using git add <filename> git add * This is the first step in the basic git workflow. To actually commit these changes use git commit -m "Commit message" Now the file is committed...

Visual Studio Code and my Setup

Image
My Top Packages Path Intelisense This helps you get the relative path of your file and help you to autocomplete path names when you do something like… import MyComponent from './src/components/MyComponent' ; Plus, this works with dependencies from your  packages.json . Project Manager This extension helps my life so much. When you have a lot of projects and don't want to waste time finding each one on your computer, you can just save them right inside the window. Just press  shift + cmd + p  and  Project Manager: Save Project . Afterwards, you can just come back to your text editor and search right in the project manager by typing  shift + cmd + p  and  Project Manager: List Projects to Open . Auto Rename Tag This one doesn't do much. But what it does do is a huge help! For example, you’re working on a React project and you want to change your component  MyApp  to be  YourApp . This extension will rename rename every ...

饥饿的盛世

Image
本文摘自张宏杰所著《饥饿的盛世》一书。 1793年,也就是乾隆五十八年夏天,英国派出的第一个访华使团到达中国。英国人对这个神秘的国度充满好奇。他们相信,中国就像《马可•波罗游记》中所写的那样,黄金遍地,人人都身穿绫罗绸缎。 然而,一登上中国的土地,他们马上发现了触目惊心的贫困。清王朝雇用了许多老百姓来到英使团的船上,为英国人端茶倒水、扫地做饭。英国人注意到这些人“都如此消瘦”。“在普通中国人中间,人们很难找到类似英国公民的啤酒肚或英国农夫喜气洋洋的脸”。这些普通中国人“每次接到我们的残羹剩饭,都要千恩万谢。对我们用过的茶叶,他们总是贪婪地争抢,然后煮水泡着喝”。 使团成员约翰•巴罗在《我看乾隆盛世》中说:“不管是在舟山还是在溯白河而上去京城的三天里,没有看到任何人民丰衣足食、农村富饶繁荣的证明……除了村庄周围,难得有树,且形状丑陋。房屋通常都是泥墙平房,茅草盖顶。偶尔有一幢独立的小楼,但是决无一幢像绅士的府第,或者称得上舒适的农舍……不管是房屋还是河道,都不能跟雷德里夫和瓦平(英国泰晤士河边的两个城镇)两岸的相提并论。事实上,触目所及无非是贫困落后的景象。” 毫无疑问,乾隆皇帝是中国历史上最伟大的皇帝之一。有的评论者甚至还去掉“之一”二字。确实,乾隆统治下的中国,纵向比,是中国几千年历史中人口最多、国力最盛的时期。横向比,是当时世界上最强大、最富庶的国家。何以我们五千年文化得出的这个集大成的盛世在英国人眼中如此黯淡? 原因是,乾隆时代中国人和欧洲人的生活水平差距实在太大了。14世纪,欧洲人并不比中国人富裕。他们的食物中肉食比重并不算高,一大块面包加一碗浓汤就已经让辛苦了一天的英国农夫心满意足。但是随着社会的发展,欧洲人的生活水平不断提升。 18世纪工业革命前期,英国汉普郡农场的一个普通雇工,一日三餐的食谱如下:早餐是牛奶、面包和前一天剩下的咸猪肉;午饭是面包、奶酪、少量的啤酒、腌猪肉、马铃薯、白菜或萝卜;晚饭是面包和奶酪。星期天,可以吃上鲜猪肉。工业革命后,英国人的生活水平更是蒸蒸日上。1808年,英国普通农民家庭的消费清单上还要加上2.3加仑脱脂牛奶、1磅奶酪、17品脱淡啤酒、黄油和糖各半磅,还有1英两茶。 而乾隆年间的中国人吃的是什么呢? 几千年来,中国农民的主要食物一直是粗粮和青菜,肉...