This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| axios({ | |
| url: 'http://localhost:5000/static/example.pdf', | |
| method: 'GET', | |
| responseType: 'blob', // important | |
| }).then((response) => { | |
| const url = window.URL.createObjectURL(new Blob([response.data])); | |
| const link = document.createElement('a'); | |
| link.href = url; | |
| link.setAttribute('download', 'file.pdf'); | |
| document.body.appendChild(link); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div it="gotop"> </div> | |
| <script> | |
| backTop = function (btnId){ | |
| var btn = document.getElementById(btnId); | |
| var d = document.documentElement; | |
| var b = document.body; | |
| window.onscroll = btnDisplay; | |
| btn.onclick = function (){ | |
| btn.style.display = "none"; | |
| window.onscroll = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //return an array of objects according to key, value, or key and value matching | |
| function getObjects(obj, key, val) { | |
| var objects = []; | |
| for (var i in obj) { | |
| if (!obj.hasOwnProperty(i)) continue; | |
| if (typeof obj[i] == 'object') { | |
| objects = objects.concat(getObjects(obj[i], key, val)); | |
| } else | |
| //if key matches and value matches or if key matches and value is not passed (eliminating the case where key matches but passed value does not) | |
| if (i == key && obj[i] == val || i == key && val == '') { // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias showusers='cut -d: -f1 /etc/passwd' | |
| alias showversion='lsb_release -a' | |
| alias lr='ls -R | grep ":$" | sed -e '\''s/:$//'\'' -e '\''s/[^-][^\/]*\//--/g'\'' -e '\''s/^/ /'\'' -e '\''s/-/|/'\''' | |
| alias gst="git status -sb" | |
| alias grmmergedbranch='git branch --merged | grep -v "\*" | grep -v master | grep -v dev | xargs -n 1 git branch -d' | |
| alias gll="git pull ; git submodule update" | |
| alias grc="git rebase --continue" | |
| alias glog="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit -- | less" | |
| alias ga="git add" | |
| alias gc="git commit -v" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if &compatible | |
| set nocompatible | |
| endif | |
| set hidden | |
| set noautochdir | |
| set shortmess=a | |
| set autowriteall | |
| filetype plugin indent on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "emojis": [ | |
| {"emoji": "👩👩👧👧", "name": "family_mothers_two_girls", "shortname": "", "unicode": "", "html": "👩‍👩‍👧‍👧", "category": "p", "order": ""}, | |
| {"emoji": "👩👩👧👦", "name": "family_mothers_children", "shortname": "", "unicode": "", "html": "👩‍👩‍👧‍👦", "category": "p", "order": ""}, | |
| {"emoji": "👩👩👦👦", "name": "family_mothers_two_boys", "shortname": "", "unicode": "", "html": "👩‍👩‍👦‍👦", "category": "p", "order": ""}, | |
| {"emoji": "👨👩👧👧", "name": "family_two_girls", "shortname": "", "unicode": "", "html": "👨‍👩‍👧‍👧", "category": "p", "order": ""}, | |
| {"emoji": "👨👩👧👦", "name": "family_children", "shortname": "", "unicode": "", "html": "👨‍👩‍👧‍👦", "category": "p", "order": ""}, | |
| {"emoji": "👨👩👦👦", "name": "family_two_boys", "shortname": "", "unicode": "", "html": "👨&zw |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #coding:utf-8 | |
| TEXT = "垂死病中惊坐起,笑问客从何处来" # 要转换成语音的文字 | |
| AUDIO_FILE = "./f.wav" # 要识别的语音文件 | |
| cuid = 'py' | |
| apiKey = "..." | |
| secretKey = "..." | |
| auth_url = "https://openapi.baidu.com/oauth/2.0/token?grant_type=client_credentials&client_id="\ | |
| + apiKey + "&client_secret=" + secretKey | |
| import urllib2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 第一步,在/etc/yum.repos.d/目录下创建一个源配置文件nginx.repo: | |
| cd /etc/yum.repos.d/ | |
| vim nginx.repo | |
| 填写如下内容: | |
| [nginx] | |
| name=nginx repo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # update_gfwlist.sh | |
| # Author : VincentSit | |
| # Copyright (c) http://xuexuefeng.com | |
| # | |
| # Example usage | |
| # | |
| # ./whatever-you-name-this.sh | |
| # | |
| # Task Scheduling (Optional) |
NewerOlder