Skip to content

Instantly share code, notes, and snippets.

View wangzuo's full-sized avatar
🎯
Focusing

Wang Zuo wangzuo

🎯
Focusing
View GitHub Profile
[
{ "keys": ["f8"], "command": "reindent"},
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} },
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} },
{ "keys": ["shift+end"], "command": "move_to", "args": {"to": "eol", "extend": true} },
{ "keys": ["shift+home"], "command": "move_to", "args": {"to": "bol", "extend": true } }
]
/**
* Stylesheet that implements Entypo font
* http://www.entypo.com/
*
* Autor Yordan Ivanov
* [email protected]
*/
@font-face {
font-family: 'EntypoRegular';
@wangzuo
wangzuo / .vimrc
Last active December 18, 2015 19:49
vimrc
execute pathogen#infect()
filetype plugin indent on
set encoding=utf-8
set tabstop=2
set expandtab
set shiftwidth=2
set shiftround
set ai
set si
@wangzuo
wangzuo / settings
Last active December 18, 2015 14:19
sublime text 2 configuration
{
"color_scheme": "Packages/Color Scheme - Default/Solarized (Light).tmTheme",
"font_size": 12.0,
"font_face": "monaco",
"word_wrap": true,
"wrap_width": 80,
"line_padding_bottom": 1,
"line_padding_top": 1,
"highlight_modified_tabs": true,
"highlight_line": true,
@wangzuo
wangzuo / example-fade.js
Created October 20, 2012 14:48
javascript closure
// Define a function that sets a DOM node's color
// to yellow and then fades it to white.
var fade = function (node) {
var level = 1;
var step = function () {
var hex = level.toString(16); node.style.backgroundColor = '#FFFF' + hex + hex; if (level < 15) {
level += 1;
setTimeout(step, 100);
}
};
@wangzuo
wangzuo / subject.rb
Created September 28, 2012 17:39
carrierwave simple validation
class Subject < ActiveRecord::Base
mount_uploader :icon, IconUploader
validates_presence_of :icon
validate :image_size_validation, :image_type_validation, :if => "icon?"
def image_size_validation
errors[:icon] << "should be less than 2MB" if icon.size > 2.megabytes
end
@wangzuo
wangzuo / rails.org
Created September 28, 2012 04:45 — forked from map7/rails.org
Rails 3.1 autocomplete using coffee-script and jquery-ui
@wangzuo
wangzuo / redcarpet.rb
Created September 23, 2012 12:24 — forked from stephencelis/redcarpet.rb
Redcarpet (Markdown) template handler for Rails 3.1.
# config/initializers/redcarpet.rb
class ActionView::Template
class Redcarpet < Handler
include Handlers::Compilable
def compile template
::Redcarpet.new(template.source).to_html.inspect
end
end
@wangzuo
wangzuo / gist:3737917
Created September 17, 2012 15:09 — forked from shijinkui/gist:3402506
HADOOP报错Incompatible namespaceIDs
今早一来,突然发现使用-put命令往HDFS里传数据传不上去了,抱一大堆错误,然后我使用bin/hadoop dfsadmin -report查看系统状态
admin@adw1:/home/admin/joe.wangh/hadoop-0.19.2>bin/hadoop dfsadmin -report
Configured Capacity: 0 (0 KB)
Present Capacity: 0 (0 KB)
DFS Remaining: 0 (0 KB)
DFS Used: 0 (0 KB)
DFS Used%: ?%
-------------------------------------------------
Datanodes available: 0 (0 total, 0 dead)
@wangzuo
wangzuo / github.css
Created September 13, 2012 03:00 — forked from theconektd/github.css
Github Markdown CSS - for Markdown Editor Preview
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {