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
| import Foundation | |
| public class FSM<StateType: Equatable, EventType: Equatable> { | |
| public struct StateTransition: CustomStringConvertible { | |
| var event: EventType | |
| var state: StateType | |
| var target: () -> StateType? | |
| init(event: EventType, state: StateType, target: @escaping () -> StateType?) { |
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/bash | |
| function modifyOrAdd(){ | |
| # 匹配符 | |
| str=$1 | |
| # 结果字符串 | |
| dst=$2 | |
| # 文件路径 | |
| file=$3 | |
| result=`sed -n "/${str}/p" ${file}` |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>加载动画</title> | |
| <link rel="stylesheet" href="loading.css"> | |
| <script type="text/javascript" src="libs/jquery-3.2.1.min.js"></script> | |
| <script> | |
| $(document).ready(function () { | |
| $(window).on('load', function () { |