Skip to content

Instantly share code, notes, and snippets.

@Reedef
Reedef / file_path_test.sh
Last active December 8, 2015 02:47 — forked from feng-ming/file_path_test.sh
unix shell 判断目录/文件是否存在, 以及是否有读写权限。
shell判断文件,目录是否存在或者具有权限
#!/bin/sh
Path="/var/log/httpd/"
File="/var/log/httpd/access.log"
#这里的-x 参数判断$Path是否存在并且是否具有可执行权限
if [ ! -x "$Path"]; then
mkdir "$Path"
fi
@Reedef
Reedef / index.html
Created September 21, 2016 00:08 — forked from anonymous/index.html
JS Bin [美团面试两列排序] // source https://jsbin.com/mejapis
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[美团面试两列排序]">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
import hoistStatics from 'hoist-non-react-statics';
import React from 'react';
/**
* Allows two animation frames to complete to allow other components to update
* and re-render before mounting and rendering an expensive `WrappedComponent`.
*/
export default function deferComponentRender(WrappedComponent) {
class DeferredRenderWrapper extends React.Component {
constructor(props, context) {
@Reedef
Reedef / uuid.js
Created January 3, 2024 02:52 — forked from chhpt/uuid.js
生成 uuid
function uuidv4() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
console.log(uuidv4())