Skip to content

Instantly share code, notes, and snippets.

@wjch
wjch / applicationContext.xml
Last active December 18, 2015 00:49
sping与sping mvc 整合
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
@Controller //让该类成为控制器
public class HelloController {
@RequestMapping(value={"/","/hello"})
public String hello(int id,Map<String,Object> map) { //使用Map传值
System.out.println(id);
System.out.println("hello");
map.put("hello", "world");
return "hello";
}

1.检索 所有:Ad.find(:all) id: Ad.find(params[:id])

够烦恼的,google下,找到答案了….

Bundle install and the root password

If you don’t want to type the root password for every new project a solution is to move the GEM paths in a directory where the user can write, otherwise a simple solution is to make that folders writable by the user.

赋予权限即可解决:

/*
sublime-imfix.c
Use LD_PRELOAD to interpose some function to fix sublime input method support for linux.
By Cjacker Huang <jianzhong.huang at i-soft.com.cn>
gcc -shared -o libsublime-imfix.so sublime_imfix.c `pkg-config --libs --cflags gtk+-2.0` -fPIC
LD_PRELOAD=./libsublime-imfix.so sublime_text
*/
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
[Desktop Entry]
Version=1.0
Name=Sublime Text 2
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Text Editor
Exec=sublime
Terminal=false
Icon=/opt/Sublime Text 2/Icon/48x48/sublime_text.png
@wjch
wjch / _config.yml
Last active December 16, 2015 18:20
default_asides: [asides/recent_posts.html, asides/weibo.html, asides/github.html]
weibo_uid: # 填入uid
weibo_verifier: # 填入verifier
weibo_fansline: 0 # 粉丝显示多少行
weibo_show: true # 是否显示最近微博内容
weibo_pic: true # 是否显示微博中的图片
weibo_skin: 10 # 使用哪种配色风格,数字为从1开始的微博秀风格序号
<section>
<h1>新浪微博</h1>
<ul id="weibo">
<li>
<iframe width="100%" height="550" class="share_self" frameborder="0" scrolling="no" src="http://widget.weibo.com/weiboshow/index.php?language=&width=0&height=550&fansRow=2&ptype=1&speed=0&skin=3&isTitle=1&noborder=1&isWeibo=1&isFans=1&uid=1847991292&verifier=05eec98a&dpc=1">
</iframe>
</li>
</ul>
</section>
@wjch
wjch / ss.sh
Last active December 16, 2015 18:20
$ ss -h
-V, --version 输出版本信息
-n, --numeric 不解析(don't resolve) service names
-r, --resolve 解析(resolve) host names
-a, --all 显示 所有socket
-l, --listening 显示 所有正在监听的socket
-o, --options 显示 timer 信息
-e, --extended 显示 详细的 socket 信息
-m, --memory 显示 socket 内存用量