Skip to content

Instantly share code, notes, and snippets.

View cyyjs's full-sized avatar
😀
I may be slow to respond.

cyyjs cyyjs

😀
I may be slow to respond.
View GitHub Profile
@cyyjs
cyyjs / html-parser.js
Created March 20, 2020 05:59
html转vnode
const openTagRE = /^<([a-z]+[^>\s]*)/;
const endTagRE = /^<\/([a-z][^\s]+)/;
const parents = [];
function parser(html) {
let ast = null;
// 去掉字符串开头的空白
html = advanceSpace(html);
@cyyjs
cyyjs / v.html
Created April 11, 2018 02:41
vue双向绑定示例
<html>
<!DOCTYPE html>
<head>
<title>myVue</title>
</head>
<style>
#app {
text-align: center;
}
@cyyjs
cyyjs / README.md
Last active March 20, 2020 06:42
改变选中元素样式

test

@cyyjs
cyyjs / gist:7556997
Created November 20, 2013 03:04
maven js 和css压缩插件
yuicompressor-maven-plugin
@cyyjs
cyyjs / applicationContext.xml
Last active February 25, 2017 16:58
Spring+MyBatis
<?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:tx="http://www.springframework.org/schema/tx"
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.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
@cyyjs
cyyjs / UserMapper.java
Last active March 20, 2018 09:39
MyBatis 使用示例 实体类中不需要注解了
package com.kaishengit.mapper;
import com.kaishengit.entity.User;
public interface UserMapper {
public User findById(int id);
public void save(User u);
public void delete(int id);
public void update(User u);
public User findPost(int i);
@cyyjs
cyyjs / ShiroDBRealm.java
Last active December 19, 2015 13:48
Shiro权限框架 导入shiro-all包
package com.kaishengit.service;
import javax.inject.Inject;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.SimpleAuthenticationInfo;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.authz.AuthorizationInfo;
@cyyjs
cyyjs / HomeController.java
Created July 9, 2013 14:55
JSR-303 服务端的验证 依赖hibernate-validator-4.xx.jar 和 validation-api-1.0.0.GA.jar
@RequestMapping(value="/new",method=RequestMethod.GET)
public String newUser(Model model) {
model.addAttribute("user", new User());
return "user/index";
}
@RequestMapping(value="/new",method=RequestMethod.POST)
public String save(@Valid User user,BindingResult bindingResult, String zip) {
if(bindingResult.hasErrors()) {
return "user/index";
@cyyjs
cyyjs / AuthorizationException.java
Last active August 28, 2024 09:55
SpringMVC相关配置和实例
package com.kaishengit.exception;
public class AuthorizationException extends RuntimeException {
private static final long serialVersionUID = 1L;
}
<?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:tx="http://www.springframework.org/schema/tx"
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.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd