Skip to content

Instantly share code, notes, and snippets.

View whatsrtos's full-sized avatar

whatsrtos whatsrtos

View GitHub Profile
@whatsrtos
whatsrtos / 测试文件.md
Last active September 30, 2022 06:08
测试不同markdown解析器对扩展语法的支持
title categories
yaml front matter 测试

此文档用于测试不同 markdown 解析器对非严格&扩展语法的支持

列表测试

  • 一级列表
  • 使用二空格进行列表缩进
@whatsrtos
whatsrtos / Golden Verses.html
Created April 19, 2021 05:45
Markdown preview theme for Editorial(iOS)
<!DOCTYPE html>
<html>
<!-- Golden Verses: Markdown theme for iOS Editorial app-->
<!-- You can change the look of the Markdown preview by editing the CSS below, for example to match your blog/website or just your personal preferences. Things between double curly braces are template variables that are replaced automatically depending on your editor settings. -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Preview</title>
<style type="text/css">
body {
margin: 0;
@whatsrtos
whatsrtos / common.php
Last active September 23, 2018 03:21
PHP
// Windows
error_log(__FILE__.':'.__LINE__.':['.date("Y-m-d G:i:s",time())."] msg: xxx\n", 3, 'c:/cy'.date("Y-m-d").'.log');
// Linux
file_put_contents('/tmp/cy'.date("Y-m-d").'.log', __FILE__.':'.__LINE__.':'."msg: xxx\n", FILE_APPEND);
// usage: outputTrace2Html(sprintf("post IDs = %s", print_r(array_keys($postIDArray),true)));
function outputTrace2Html($msg,$new=false)
{
@whatsrtos
whatsrtos / merge_sort.cpp
Last active September 23, 2018 03:21
C/C++
public static void mergeSort(int[] arr) {
mSort(arr, 0, arr.length-1);
}
/**
* 递归分治
* @param arr 待排数组
* @param left 左指针
* @param right 右指针
*/
@whatsrtos
whatsrtos / bash-common.sh
Last active October 20, 2018 07:45
Bash
# 数组
ip_array=(10.10.80.158 10.10.80.159 10.10.80.160)
echo ${ip_array[*]} # 以一个字符串打印所有元素
echo ${ip_array[@]} # 每个元素作为一个字符串
echo ${#ip_array[*]} # 数组元素个数
# 字符串
len=${#str} #长度
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME) // 使用元注解
public @interface Controller { // 注解的定义: modifier @interface Annotation
String value() default ""; // 注解的方法都是这种格式: Type elementName() default defaultVal;
}
// RequestMapping
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Mapping