Skip to content

Instantly share code, notes, and snippets.

@NemoAlex
NemoAlex / index.html
Created July 31, 2022 12:35
Electron Windows 7 test
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'">
<link href="./styles.css" rel="stylesheet">
<title>Hello World!</title>
</head>
<body>
@NemoAlex
NemoAlex / frpc
Created August 20, 2018 14:42
/etc/init.d/frpc on OpenWrt
#!/bin/sh /etc/rc.common
START=99
USE_PROCD=1
start_service() {
procd_open_instance "frpc"
procd_set_param command /root/frp/frpc -c /root/frp/frpc.ini
procd_set_param stdout 1
procd_set_param stderr 1
javascript:(function(){open('https://chart.googleapis.com/chart?chs=150x150&cht=qr&choe=UTF-8&chl='+encodeURIComponent(document.location.href));})()
@NemoAlex
NemoAlex / uri.js
Created January 26, 2014 02:09 — forked from jlong/uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@NemoAlex
NemoAlex / gist:8144724
Created December 27, 2013 09:50
复制到 Alfred,可以用 “dict [单词]” 搜索必应词典
alfred://customsearch/Search%20%7Bquery%7D%20in%20%E5%BF%85%E5%BA%94%E8%AF%8D%E5%85%B8/dict/utf8/noplus/http://cn.bing.com/dict/search?q={query}
@NemoAlex
NemoAlex / gist:3551983
Created August 31, 2012 12:10
Set MplayerX - SeekStepTime
# Using Terminal set MplayerX SeekStep to 8s.
cd ~/Library/Preferences/
defaults write org.niltsh.MPlayerX SeekStepTimeR 8
defaults write org.niltsh.MPlayerX SeekStepTimeL 8
# Then restart MplayerX.app if it is running.
@NemoAlex
NemoAlex / gist:2879405
Created June 6, 2012 02:07
Squirrel 配色方案修改
更新:建议编辑 ~/Library/Rime/squirrel.custom.yaml 文件,而不要在 squirrel.yaml 上做改动
新版本加入了对边距宽高的订制,感谢作者
patch:
us_keyboard_layout: true
style/horizontal: false
style/font_face: "Helvetica Neue"
style/font_point: 21
style/corner_radius: 4
style/border_height: 4
@NemoAlex
NemoAlex / gist:2316620
Created April 6, 2012 03:35
在 Rime 中加入"["和"]"翻页按键绑定
# default.custom.yaml
# save it to:
# ~/.ibus/rime (linux)
# ~/Library/Rime (macos)
# %APPDATA%\Rime (windows)
patch:
key_binder:
bindings:
- accept: "Control+p"
@NemoAlex
NemoAlex / Detective.html
Created March 13, 2012 08:29
File Detective
<!DOCTYPE html>
<html>
<header>
<title>File Detective</title>
</header>
<body>
<h1>File Detective</h1>
<p>
<a href="javascript:(function(){function getFileType(a) { a = a.split('.'); if (a.length == 1) return false; if (~a[a.length - 1].indexOf('/')) return false; return a[a.length - 1] } for (var fileList = [], els = document.getElementsByTagName('a'), i = 0; els[i]; i++) getFileType(els[i].href) && fileList.push('\'' + els[i].href + '\''); var ta = document.createElement('textarea'); ta.setAttribute('onclick', 'this.select()'); ta.setAttribute('style', 'width:100%'); ta.setAttribute('rows', fileList.length); ta.innerHTML = fileList.join(' '); document.body.appendChild(ta);})()">Detective</a>
</p>