Skip to content

Instantly share code, notes, and snippets.

View raphaelsoul's full-sized avatar
㊗️
Question: why it works? why it not works? why it works after I restart?

Dechen Zhuang raphaelsoul

㊗️
Question: why it works? why it not works? why it works after I restart?
  • China
View GitHub Profile
Coverage Badge
@raphaelsoul
raphaelsoul / qqlogin.js
Created February 4, 2021 14:25
QQMusicLogin
const login = async () => {
const browser = await puppeteer.launch({
headless: false,
devtools: true,
});
try {
const page = await browser.newPage();
await page.goto('https://y.qq.com', {
waitUntil: 'networkidle0'
});
@raphaelsoul
raphaelsoul / App.tsx
Created November 27, 2020 02:41
nested react router
import React from "react"
import {BrowserRouter, StaticRouter, Switch, Route, Link, Redirect} from "react-router-dom";
import Hello from "./Hello"
import World from "./World"
const isSSR = typeof window === "undefined"
const Router = isSSR ? StaticRouter : BrowserRouter
export default ({url}) => {
@raphaelsoul
raphaelsoul / example.js
Created February 28, 2020 05:17
唤醒口袋铃声小程序示例
// 暂时只支持带spinfocode唤醒小程序首页 近期将提供其他页面或url到达能力 届时path参数可能会变
wx.navigateToMiniProgram({
appId: '<APPID>',
path: `pages/index/index`,
extraData: {
spinfocode: '<spinfocode>',
},
envVersion: "release",
success: () => console.log("jump success"),
fail: (e) => console.log("jump failed", e),
@raphaelsoul
raphaelsoul / getMiguMethodNames.js
Created March 8, 2019 03:24
migu sdk function names
// get from `Object.keys(window)` in an empty page
const loaded = 'postMessage|blur|focus|close|parent|opener|top|length|frames|closed|location|self|window|document|name|customElements|history|locationbar|menubar|personalbar|scrollbars|statusbar|toolbar|status|frameElement|navigator|origin|external|screen|innerWidth|innerHeight|scrollX|pageXOffset|scrollY|pageYOffset|visualViewport|screenX|screenY|outerWidth|outerHeight|devicePixelRatio|clientInformation|screenLeft|screenTop|defaultStatus|defaultstatus|styleMedia|onanimationend|onanimationiteration|onanimationstart|onsearch|ontransitionend|onwebkitanimationend|onwebkitanimationiteration|onwebkitanimationstart|onwebkittransitionend|isSecureContext|onabort|onblur|oncancel|oncanplay|oncanplaythrough|onchange|onclick|onclose|oncontextmenu|oncuechange|ondblclick|ondrag|ondragend|ondragenter|ondragleave|ondragover|ondragstart|ondrop|ondurationchange|onemptied|onended|onerror|onfocus|oninput|oninvalid|onkeydown|onkeypress|onkeyup|onload|onloadeddata|onloadedmetadata
@raphaelsoul
raphaelsoul / gen_openssl_cert.sh
Created February 27, 2019 07:41
create a tls cert to protect docker API
openssl genrsa -aes256 -out ca-key.pem 4096
openssl req -new -x509 -days 3650 -key ca-key.pem -sha256 -out ca.pem
openssl genrsa -out server-key.pem 4096
openssl req -subj "/CN=YOUR_IP_ADDR" -sha256 -new -key server-key.pem -out server.csr
echo subjectAltName = DNS:YOUR_IP_ADDR,IP:YOUR_IP_ADDR,IP:127.0.0.1 > extfile.cnf
echo extendedKeyUsage = serverAuth >> extfile.cnf
@raphaelsoul
raphaelsoul / swarm.yml
Created January 29, 2019 08:00 — forked from MetalArend/swarm.yml
Run a GitLab Runner on your Swarm
version: '3.4'
secrets:
# Find your registration token at: "Your project" > "Settings" > "CI/CD" > "Runners settings" > "Specific Runners" (look for registration token)
# Register it as `GITLAB_REGISTRATION_TOKEN`: `docker secret create GITLAB_REGISTRATION_TOKEN YOUR_REGISTRATION_TOKEN`
GITLAB_REGISTRATION_TOKEN:
external: true
# Find your personal access token at: "Your user account" > "Settings" > "Access Tokens" > "Create personal access token" (for api)
# Register it as `GITLAB_PERSONAL_ACCESS_TOKEN`: `docker secret create GITLAB_PERSONAL_ACCESS_TOKEN <YOUR ACCESS TOKEN>`
@raphaelsoul
raphaelsoul / docker-cleanup-resources.md
Last active March 27, 2019 15:42 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

0xc3ec90F6475AD5FA990a255844b1B008115f3A95
@raphaelsoul
raphaelsoul / url.md
Created June 21, 2018 02:20
oauth2 design note