This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def fibonacci(): | |
| a = b = 1 | |
| yield a | |
| yield b | |
| while True: | |
| a, b = b, a + b | |
| yield b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Manxisuo's Test! | |
| */ | |
| background: linear-gradient(45deg, #f06, yellow); | |
| background: #fff; | |
| min-height: 100%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| const INITIAL = 0; | |
| const RUNNING = 1; | |
| var inDebugMode = false; | |
| function JTPool(maxThread) { | |
| this.status = INITIAL; | |
| this.workQueue = []; // workQueue = [{id: xx, task: xx}] | |
| this.max = (undefined == maxThread) ? 3 : maxThread; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 使用方法: | |
| 1. 将XML转为JS对象: | |
| JXParser.xml2Json(xml); | |
| 2. 将JS对象或JSON字符串转为XML: | |
| JXParser.xml2Json(xml); | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;(function (window) { | |
| function Template(str) { | |
| this.str = str; | |
| } | |
| Template.prototype.format = function () { | |
| var arg = arguments[0] instanceof Array ? arguments[0] : arguments; | |
| return this.str.replace(/\{(\d+)\}/g, function (a, b) { | |
| return arg[b] || ''; | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @arr 待处理数组 | |
| * @handler 处理函数 | |
| */ | |
| function handleBatch(arr, handler) { | |
| // 参数校验 | |
| if (!arr || arr.length == 0 || !handler) return; | |
| // 如果没有回调,则直接用循环; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| cd ~/git/blogger | |
| export tmp=`ps -ef |grep jekyll|head -n1|awk '{print $2}'` | |
| kill -9 $tmp | |
| rm -rf _site | |
| jekyll serve & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # find 文件路径 -name '文件名称模板' | xargs grep '包含的特定文本模板' | |
| find ./ -name '*' | xargs grep 'hello' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>ST</groupId> | |
| <artifactId>ai</artifactId> | |
| <version>0.0.1-SNAPSHOT</version> | |
| <!-- Shared version number properties --> | |
| <properties> | |
| <org.springframework.version>3.0.0.RELEASE</org.springframework.version> | |
| </properties> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| selector { | |
| width: 270px; | |
| overflow-x: hidden; | |
| text-overflow: ellipsis; | |
| white-space: nowrap; | |
| } |