Skip to content

Instantly share code, notes, and snippets.

View buddalee's full-sized avatar
🚲
Work in the Bicycle Industry

Roy Lee buddalee

🚲
Work in the Bicycle Industry
View GitHub Profile
@buddalee
buddalee / console.save.js
Created November 17, 2021 09:04 — forked from raecoo/console.save.js
Save JSON object to file in Chrome Devtool
// e.g. console.save({hello: 'world'})
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'
if(typeof data === "object"){
data = JSON.stringify(data, undefined, 4)
@buddalee
buddalee / example.js
Created June 4, 2021 08:17 — forked from magemore/example.js
upload image from clipboard on ctrl+v event on page
function uploadFile(file) {
var formData = new FormData();
formData.append("userfile", file);
var request = new XMLHttpRequest();
request.onload = function () {
if (request.status == 200) {
document.location.href='/';
} else {
alert('Error! Upload failed');
}
@buddalee
buddalee / settings.json
Created February 14, 2020 09:31 — forked from doggy8088/settings.json
Will 保哥的 VSCode 使用者設定檔
{
"explorer.openEditors.visible": 0,
"workbench.colorTheme": "Default Light+",
"workbench.iconTheme": "vscode-simpler-icons",
"workbench.sideBar.location": "right",
// 需下載安裝 Fira Code 字型 (安裝 OTF 格式)
// https://github.com/tonsky/FiraCode/releases
// 需下載客製化過的 Microsoft YaHei Mono 字型