Skip to content

Instantly share code, notes, and snippets.

@mebiusbox
mebiusbox / loadFiles.js
Created July 1, 2017 09:34
Simple file loader
function loadFile(url, data, callback, errorCallback) {
// Set up an asynchronous request
var request = new XMLHttpRequest();
request.open('GET', url, true);
// Hook the event that gets called as the request progresses
request.onreadystatechange = function() {
// If the request is "DONE" (completed or failed)
if (request.readyState == 4) {
// If we got HTTP status 200 (OK)
@mebiusbox
mebiusbox / copyToClipboardForBoostnote.bat
Created March 25, 2017 06:24
Copy the dropped files as image element of markdown to clipboard for boostnote on windows
@echo off
setlocal enabledelayedexpansion
for %%f in (%*) do (
set fullpath=%%f
set /P<NUL="^![%%~nxf](!fullpath:\=/!)"|clip
)
endlocal
@mebiusbox
mebiusbox / saveAsHashName.bat
Created March 25, 2017 03:10
Save the dropped files as hash name batch
: Fciv is required. Please download from below and expand to any place, and add the path to fciv.
: https://support.microsoft.com/ja-jp/help/841290/availability-and-description-of-the-file-checksum-integrity-verifier-utility
@echo off
setlocal enabledelayedexpansion
rem set PATH=%PATH%;{fciv path}
for %%f in (%*) do (
set NAME=
for /f "usebackq tokens=1" %%a in (`fciv %%f`) do set NAME=%%a
copy %%f "%~dp0!NAME!%%~xf"
)