Skip to content

Instantly share code, notes, and snippets.

HACK21 HACK21

Block or report user

Report or block HACK21

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View copyToClipboard.js
function copyToClipboard(element) {
var $temp = $("<textarea></textarea>");
$("body").append($temp);
$temp.text("aaaa").select();
document.execCommand("copy");
$temp.remove();
}
View request.js
// Learnd From @石濑
// Fetch Data
const request = new Promise(function(resolve, reject) {
fetch(
sth,
success => resolve('data'),
fail=> reject('reason')
);
})
@HACK21
HACK21 / InitArray.js
Created May 15, 2017
Init empty Array width default value
View InitArray.js
function range(len){
return Array.apply(null, Array(len)).map(function (v,k) { return k });
}
View deferComponentRender.js
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) {
@HACK21
HACK21 / index.html
Created Sep 21, 2016 — forked from anonymous/index.html
JS Bin [美团面试两列排序] // source https://jsbin.com/mejapis
View index.html
<!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>
@HACK21
HACK21 / file_path_test.sh
Last active Dec 8, 2015 — forked from feng-ming/file_path_test.sh
unix shell 判断目录/文件是否存在, 以及是否有读写权限。
View file_path_test.sh
shell判断文件,目录是否存在或者具有权限
#!/bin/sh
Path="/var/log/httpd/"
File="/var/log/httpd/access.log"
#这里的-x 参数判断$Path是否存在并且是否具有可执行权限
if [ ! -x "$Path"]; then
mkdir "$Path"
fi
@HACK21
HACK21 / nn_api
Last active Aug 29, 2015
暖暖项目
View nn_api
|接口|URL|参数|返回|备注|
|-|-|-|-|
|发送验证码|/api/code|mobile|JSON|0新用户注册 1重置密码|
|用户注册|/api/sign-up|mobile,nickname,password,code|JSON|
|用户登录|/api/sign-in|mobile,password|JSON|
|修改密码|/api/password-update|uid,mobile,old_password,new_password|JSON|
|名医列表|/api/doctor-list|page,pagesize|JSON|
|创建问题(瓶子)|/api/question-create|uid,title,age,duration|JSON||
|问题列表|/api/question-list|uid,type,page,pagesize|JSON|type 1他人问题2我的问题|
View Scala Note
Scala NOTE
---
#### **Spark执行方式**
- 命令行模式
- spark-shell
- pyspark
- 脚本运行
- spark-submit user-script
You can’t perform that action at this time.