Skip to content

Instantly share code, notes, and snippets.

@lirongfei123
lirongfei123 / 上传文件
Created February 10, 2019 04:43
ajax相关 #ajax
var formData = new FormData();
var name = $("input").val();
formData.append("file",$("#upload")[0].files[0]);
formData.append("name",name);
$.ajax({
url : Url,
type : 'POST',
data : formData,
// 告诉jQuery不要去处理发送的数据
processData : false,
```
const path = d3.path()
path.rect(0, 10, 30, 40);
console.log(path);
svg.append('g').append("path").attr('d', path.toString())
.style("stroke", 'red');
```
@lirongfei123
lirongfei123 / es6 引用传值
Created January 24, 2019 06:57
错误类型
当你在入口文件设置了全局变量, 然后引用其他文件, 如果没有强依赖关系
那么这个全局变量在子文件当中是读取不了的
2、修改profile文件:
#vi /etc/profile
在里面加入:
export PATH="$PATH:/opt/au1200_rm/build_tools/bin"
让环境变量立即生效需要执行如下命令:
error_page 404 /index.html;
@lirongfei123
lirongfei123 / 备份
Last active November 21, 2019 09:58
mysql #mysql
一、备份常用操作基本命令
1、备份命令mysqldump格式
格式:mysqldump -h主机名 -P端口 -u用户名 -p密码 –database 数据库名 > 文件名.sql
2、备份MySQL数据库为带删除表的格式
备份MySQL数据库为带删除表的格式,能够让该备份覆盖已有数据库而不需要手动删除原有数据库。
mysqldump --add-drop-table -uusername -ppassword -database databasename > backupfile.sql
@lirongfei123
lirongfei123 / scp
Created January 14, 2019 03:31
scp
从服务器下载整个目录
scp -r username@servername:remote_dir/ /tmp/local_dir
上传目录到服务器
scp -r /tmp/local_dir username@servername:remote_dir
@lirongfei123
lirongfei123 / mac刷新dns
Last active April 10, 2022 02:18
mac #mac
sudo killall -HUP mDNSResponder
@lirongfei123
lirongfei123 / sublime_text_3_license_key
Created May 16, 2018 03:34 — forked from tungpt247/sublime_text_3_license_key
Sublime Text 3 License Key (Build 3065)
—– BEGIN LICENSE —–
K-20
Single User License
EA7E-940129
3A099EC1C0B5C7C5 33EBF0CF BE82FE3B
@lirongfei123
lirongfei123 / nodejs-tcp-example.js
Created May 1, 2017 08:33 — forked from tedmiston/nodejs-tcp-example.js
Node.js tcp client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');