Skip to content

Instantly share code, notes, and snippets.

Wei Gao villadora

Block or report user

Report or block villadora

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View jidan-30.md

柯达 98协议 收购当时国内7家企业中的6家 形成垄断,但如今却破产

@villadora
villadora / git-p4-sc.md
Last active Dec 10, 2015
git-p4 source code
View git-p4-sc.md

git-p4.py

  • p4_build_cmd: 执行p4 commands时,用户可能并不希望在当前默认的环境下执行,而希望指定user, client等信息,而为了统一,并且省去每次都要输入一大堆p4参数的困扰,git-p4在对所有的p4 command ...调用都用p4_build_cmd进行包装,加上-u|-c|-p等参数。而这些参数又都是从gitConfig中获得的

  • gitConfig:这个方法很简单,只是利用git config命令获取属性的值并缓存到_gitConfig这个hash map中。git-p4利用了git自己的config设置来储存相关属性,如:'git-p4.user','git-p4.port','git-p4.client'等,这些属性都是以git-p4开头,方便进行管理。

  • main: 这个是程序的主入口,他的工作是分析命令行,获得要执行的命令,之后把控制转移到相关的类中。main里面用comands这样一个hash map来进行控制的跳转。

    commands = {

View tail-rec.md

In traditional recursion, the typical model is that recursive calls are performed first, and then take the return value of the recursive call and calculate the result. In this manner, you don't get the result of calculation until you have returned from every recursive call.

In tail recursion, calculations are performed first, and then execute the recursive call, passing the results of current step to the next recursive step. The last statement is formed like"(return (recursive-function params))"

View linux-boot.md

linux boot process:

  1. BIOS: 位于ROM中,全程是basic input output system,主要负责启动基本输入输出硬件,然后将管理权交给MBR

  2. MBR:

  3. grub/lilo: bootloader

  4. kernal

View BCD.md

Boot Configuration Data

Boot Configuration Data (BCD) is a firmware-independent database for boot-time configuration data. It replaces the boot.ini that was used by NTLDR, and is used by Microsoft's new Windows Boot Manager.

Boot Configuration Data are stored in a data file that has the same format as the Windows Registry.[1] The file is located either on the EFI System Partition (on machines that use Extensible Firmware Interface firmware) or in \Boot\Bcd on the system volume (on machines that use IBM PC compatible firmware).

Boot Configuration Data may be altered using a command-line tool (bcdedit.exe), using Registry Editor (regedit.exe), using Windows Management Instrumentation, or with third party tools like EasyBCD.

Boot Configuration Data contain the menu entries that are presented by the Windows Boot Manager, just as boot.ini contained the menu entries that were presented by NTLDR. These menu entries can include:

View jasmine-js-usage.md

Jasmine测试

Jasmine的语法很简单,个人觉得比qunit稍微复杂点。但是好在可以直接在页面上集成测试,被测试的页面和测试结果显示在同一页面,非常方便。配合phantomJS那是相当舒服。jasmine-phantom

  • 测试页面与测试结果显示在同一页面,直接在测试页面上进行状态监测,使得测试更准确也更容易。
View fish-shell.md

Fish Shell github

感觉很不错的一个shell, 有几个功能是非常吸引人的:

  1. Autosuggestions, 自动补全非常强大,可以自己轻松的设定。
  2. Web Configuration, 配置自己的颜色简单了,看到各种ansii码就头痛。

但是最成功的不是这些特性,而是他设计的时候就对于其他的shell来说是容易替换的,他提供额外的功能,但是不会改变你的日常行为。就在一台没有fish_shell的机器上你会觉得还ok,只是觉得不方便而已,不会觉得自己好像换了一个shell.

You can’t perform that action at this time.