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
villadora / jshintrc
Created Aug 26, 2013
jshintrc with comments
View jshintrc
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 20, // Maximum errors before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
"node" : false,
View proxy.rb
#!/usr/bin/env ruby
# A quick and dirty implementation of an HTTP proxy server in Ruby
# because I did not want to install anything.
# Copyright (C) 2009 Torsten Becker <>
require 'socket'
require 'uri'
View Default.sublime-keymap
{ "keys": ["alt+q"], "command": "wrap_lines" },
{ "keys": ["ctrl+o"], "command": "sbp_open_line" },
// Emacs style go to indentation, alt+e can be complicated on Macs
{ "keys": ["alt+a"], "command": "move_to", "args": {"to": "bol", "extend": false} },
{ "keys": ["alt+e"], "command": "move_to", "args": {"to": "eol", "extend": false} },
{ "keys": ["alt+e"], "command": "move_to", "args": {"to": "eol", "extend": true}, "context":
{ "key": "sbp_emacs_has_mark", "operator": "equal", "operand": true }

Fish Shell github

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

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





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

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:


linux boot process:

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

  2. MBR:

  3. grub/lilo: bootloader

  4. kernal


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))"

villadora /
Last active Dec 10, 2015
git-p4 source code

  • 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 = {

You can’t perform that action at this time.