Skip to content

Instantly share code, notes, and snippets.

@aliencode
aliencode / dis-iframe.md
Created December 30, 2014 08:15
ADblock屏蔽所有iFrame元素

屏蔽所有iFrame元素,大多数广告都是以iframe的方法显示

*$subdocument
@aliencode
aliencode / docker.md
Created November 17, 2014 01:52
docker配置rest http服务

配置文件地址:

/etc/default/docker

开启配置:

DOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock"
@aliencode
aliencode / zen-coding.md
Last active August 29, 2015 14:04
zen-coding
div.container>p+table>tr[data-scroll-reveal='enter bottom']*30>td*10>{item$$}

生成:

    <div class="container">
        <p></p>
 
@aliencode
aliencode / jenkins.sh
Created May 7, 2014 06:22
jenkins.sh 启动脚本
#!/bin/sh
DESC="Jenkins CI Server"
NAME=jenkins
PIDFILE=$NAME.pid
COMMAND="${PWD}/jdk1.7.0_21/bin/java -- -Xms128m -Xmx1024m -jar ${PWD}/jenkins.war"
d_start() {
export JENKINS_HOME=${PWD}/.jenkins
@aliencode
aliencode / tomcat-users.xml
Created March 19, 2014 07:33
Tomcat 管理员 权限配置
<tomcat-users>
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary.
-->
<!--
NOTE: The sample user and role entries below are wrapped in a comment
and thus are ignored when reading this file. Do not forget to remove
<!.. ..> that surrounds them.
@aliencode
aliencode / HttpServletResponse.md
Last active January 4, 2016 13:39
HttpServletResponse 增加输出

##HttpServletResponse 流只能读取一次,通过以下方法增加输出

public class ResponseLoggingFilter extends GenericFilterBean {

   @Override
   public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
      HttpServletResponse responseWrapper = loggingResponseWrapper((HttpServletResponse) response);     
      filterChain.doFilter(request, responseWrapper);
 }
@aliencode
aliencode / jquery-table-checkbox.js
Created November 19, 2013 06:31
jquery table checkbox 列选择
$('table tr input[type=checkbox]:nth-child(1) ').prop('checked', $(e.target).prop('checked'));
@aliencode
aliencode / jsbin.OQEbOPE.html
Last active December 25, 2015 11:49
angularjs service,factory,provider区别
<!DOCTYPE html>
<html ng-app="app">
<head>
<meta name="description" content="angularjs service,factory,provider区别" />
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.0.1/angular.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body ng-controller="MyCtrl">
{{serviceOutput}}
@aliencode
aliencode / angularjs.md
Created October 5, 2013 05:43
angularJS一些

##$q的使用

var q = $q.defer(),
    p = q.promise;

chrome.fileSystem.chooseEntry({type: "openWritableFile", accepts: [
        {extensions: ["md"]}
    ]},
    function (entry) {
@aliencode
aliencode / js.utils.md
Last active December 24, 2015 15:59
js 常用函数

##replace 替换/和. 为 -

function convertToid(path) {
    return  path.replace(/\.|\//g, '-')
}

##endwith