Skip to content

Instantly share code, notes, and snippets.

View bsmagic's full-sized avatar

春消息 bsmagic

  • Tokamak
View GitHub Profile
@bsmagic
bsmagic / gist:73aaca5facaed10b41fc88a311bbe9dc
Last active December 23, 2021 01:09
Take gist as private or personal twitter or webo like publishing platform

其实把gist作为一个人微博平台,当做笔记软件使用。 如何实现mindflow的瀑布流效果?

@bsmagic
bsmagic / gist:0da419d570abac1e908b94465886a404
Last active May 31, 2021 06:28
A bookmarklet for richtext editor without 3rd-part javascript code
data:text/html;base64,PGh0bWw+CjxoZWFkPgo8dGl0bGU+UmljaCBUZXh0IEVkaXRvcjwvdGl0bGU+CjxzY3JpcHQgdHlwZT0idGV4dC9qYXZhc2NyaXB0Ij4KdmFyIG9Eb2MsIHNEZWZUeHQ7CgpmdW5jdGlvbiBpbml0RG9jKCkgewogIG9Eb2MgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgidGV4dEJveCIpOwogIHNEZWZUeHQgPSBvRG9jLmlubmVySFRNTDsKICBpZiAoZG9jdW1lbnQuY29tcEZvcm0uc3dpdGNoTW9kZS5jaGVja2VkKSB7IHNldERvY01vZGUodHJ1ZSk7IH0KfQoKZnVuY3Rpb24gZm9ybWF0RG9jKHNDbWQsIHNWYWx1ZSkgewogIGlmICh2YWxpZGF0ZU1vZGUoKSkgeyBkb2N1bWVudC5leGVjQ29tbWFuZChzQ21kLCBmYWxzZSwgc1ZhbHVlKTsgb0RvYy5mb2N1cygpOyB9Cn0KCmZ1bmN0aW9uIHZhbGlkYXRlTW9kZSgpIHsKICBpZiAoIWRvY3VtZW50LmNvbXBGb3JtLnN3aXRjaE1vZGUuY2hlY2tlZCkgeyByZXR1cm4gdHJ1ZSA7IH0KICBhbGVydCgiVW5jaGVjayBcIlNob3cgSFRNTFwiLiIpOwogIG9Eb2MuZm9jdXMoKTsKICByZXR1cm4gZmFsc2U7Cn0KCmZ1bmN0aW9uIHNldERvY01vZGUoYlRvU291cmNlKSB7CiAgdmFyIG9Db250ZW50OwogIGlmIChiVG9Tb3VyY2UpIHsKICAgIG9Db250ZW50ID0gZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUob0RvYy5pbm5lckhUTUwpOwogICAgb0RvYy5pbm5lckhUTUwgPSAiIjsKICAgIHZhciBvUHJlID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgicHJlIik7CiAgICBvRG9jLmNvbnRlbn
@bsmagic
bsmagic / onelineEditorBookmarklet++.html
Created January 4, 2021 07:08
Oneline javascript bookmarklet richtext editor
data:text/html,<title>RTextEditor</title><html contenteditable style="font-size: 1.5em; width: 100%; height: 100%; border: none; outline: none;background-color:powderblue;"><input type=button value="B" onClick="document.execCommand('Bold');"/><hr><div id="editbox">Text</div></html>
@bsmagic
bsmagic / pipTest.py
Last active January 16, 2021 13:23
Check Pip version
import numpy as np
import scipy as sp
import pandas as pd
import pip
if pip.__version__ >= "10.0.0":
from pip._internal.utils.misc import get_installed_distributions
else:
from pip import get_installed_distributions
@bsmagic
bsmagic / createNotepadbyBookmaklet.md
Last active December 30, 2020 06:48
Oneline temporary text editor created by bookmarklet in modern web browsers
data:text/html, <title>TextEditor</title><textarea style="font-size: 1.5em; width: 100%; height: 100%; border: none; outline: none;background-color:powderblue;" autofocus />

>"程序员 Jose Jesus Perez Aguinaga 在 CoderWall 分享了一个小技巧:在浏览器地址栏中输入一行代码:data:text/html, ,回车即可把浏览器变临时编辑器(需要浏览器支持 HTML5 属性 contenteditable)。

@bsmagic
bsmagic / onenoteClipperHotkey.ahk
Last active October 6, 2024 10:29
Support using hotkey to clip the selected content to local onenote
;An autohotkey script
EnvGet, ProgramFiles32, ProgramFiles(x86)
onenote := "\Microsoft Office\root\Office16\ONENOTE.EXE"
onenote32 := ProgramFiles32 . onenote
onenote64 := A_ProgramFiles . onenote
;msgbox, % onenote32
ONENOTE_PATH:="C:\Program Files\Microsoft Office\root\Office16\ONENOTE.EXE"
if FileExist(onenote64) {
ONENOTE_PATH:=onenote64
@bsmagic
bsmagic / listen1_aha_playlist.md
Created March 14, 2020 09:27
updated by Listen1(http://listen1.github.io/listen1/) at 2020/3/14 下午5:27:08

本歌单由Listen1创建, 歌曲数:2,歌单数:1,点击查看更多