Skip to content

Instantly share code, notes, and snippets.

@alvin2ye
alvin2ye / .vimrc
Created August 24, 2009 02:49
.vimrc
filetype on " Automatically detect file types.
set nocompatible " We don't want vi compatibility.
"Add recently accessed projects menu (project plugin)
set viminfo^=!
" Minibuffer Explorer Settings
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
@alvin2ye
alvin2ye / aa
Created August 24, 2009 04:43
install agi-vim
#!/bin/sh
if [ -e ~/.vim ]; then
echo "WARNING: pls backup your ~/.vim and \n rm -rf .vim "
exit
fi
if [ -e ~/.vimrc ]; then
echo "WARNING: pls backup your ~/.vimrc and \n rm ~/.vimrc "
exit
#!/usr/bin/env bash
if [ -z $1 ]; then
echo curl http://gist.github.com/166924.txt | sh
else
echo curl http://gist.github.com/$1.txt | sh
fi
// 用 prototype 得到已经选择中的 checkbox
$$('tbody input[type=checkbox]:checked').size()
@alvin2ye
alvin2ye / gist:177350
Created August 29, 2009 01:17
C# 运行 exe
using System;
using System.Diagnostics;
namespace csharp_station.howto
{
/// <summary>
/// Demonstrates how to start another program from C#
/// </summary>
class ProcessStart
{
@alvin2ye
alvin2ye / gist:177403
Created August 29, 2009 05:37
分页打印
分页打印 分页符号
<div class="page_symbol">&nbsp;</div>
.page_symbol {
page-break-after: always;
}
run "rm public/index.html"
generate(:scaffold, "post title:string body:text")
route "map.root :controller => :posts"
rake("db:migrate")
@alvin2ye
alvin2ye / gist:178998
Created September 1, 2009 09:11
remove_blank_line
function remove_blank_line(txt) {
return txt.replace(/^\s*\n/gm, '');
}
#!/usr/bin/env bash
ruby script/plugin install git://github.com/alvin2ye/dry_view.git --force
<%= javascript_tag " Event.observe(window, 'load', move_to_pos(#{@tpl.el_ids_arr.to_json}, #{@tpl.el_pos.to_json}));" -%>