首先不同网站,当然可以使用同一个邮箱,比如我的github,gitlab,bitbucket的账号都是monkeysuzie[at]gmail.com 这时候不用担心密钥的问题,因为这些网站push pull 认证的唯一性的是邮箱 比如我的windows 上 2个账号一个gitlab 一个github (用的都是id_rsa)
host github
hostname github.com
Port 22
host gitlab.zjut.com
<?php | |
/** | |
* PHP数组不定长多键值排序 | |
* | |
* @author Zjmainstay | |
* @website http://www.zjmainstay.cn, https://glot.io/snippets/ernfkfnjhb | |
* @param array $list 数据源 | |
* @param array $rules 排序规则 ['key1'=>'asc', 'key2' => 'desc', ...] | |
* @return array | |
*/ |
一、数组操作的基本函数 | |
数组的键名和值 | |
array_values($arr); 获得数组的值 | |
array_keys($arr); 获得数组的键名 | |
array_flip($arr); 数组中的值与键名互换(如果有重复前面的会被后面的覆盖) | |
in_array("apple",$arr); 在数组中检索apple | |
array_search("apple",$arr); 在数组中检索apple ,如果存在返回键名 | |
array_key_exists("apple",$arr); 检索给定的键名是否存在数组中 | |
isset($arr[apple]): 检索给定的键名是否存在数组中 | |
数组的内部指针 |
<?php | |
// FOLLOW A SINGLE REDIRECT: | |
// This makes a single request and reads the "Location" header to determine the | |
// destination. It doesn't check if that location is valid or not. | |
function get_redirect_target($url) | |
{ | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_HEADER, 1); | |
curl_setopt($ch, CURLOPT_NOBODY, 1); |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<video></video> | |
<br/> | |
<input type="file" name="file" id="fileItem" onchange="onChange()" > |
/** | |
* PHP's curl extension won't let you pass in strings as multipart file upload bodies; you | |
* have to direct it at an existing file (either with deprecated @ syntax or the CURLFile | |
* type). You can use php://temp to get around this for one file, but if you want to upload | |
* multiple files then you've got a bit more work. | |
* | |
* This function manually constructs the multipart request body from strings and injects it | |
* into the supplied curl handle, with no need to touch the file system. | |
* | |
* @param $ch resource curl handle |
# Open Terminal | |
vim ~/.vimrc | |
# Mac OS-X -> .vimrc ; Window -> .gvimrc | |
# Add it in the file and adjust the font size (h12) accordingly | |
set guifont=Menlo\ Regular:h15 |
Mac OS X system settings
> Security & Privacy
> privacy
tab
Select Full Disk Access and click plus icon.
Add terminal in the list ( in my case iTerm)
Restart iTerm
Run command in iterm: $ cd /private/etc && sudo touch ./exports
Start virtual machine trough vargrant: Profit
const base64 = 'data:image/png;base65,....' // Place your base64 url here. | |
fetch(base64) | |
.then(res => res.blob()) | |
.then(blob => { | |
const fd = new FormData(); | |
const file = new File([blob], "filename.jpeg"); | |
fd.append('image', file) | |
// Let's upload the file | |
// Don't set contentType manually → https://github.com/github/fetch/issues/505#issuecomment-293064470 |
package main
import (
"crypto/md5"
//"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"