Skip to content

Instantly share code, notes, and snippets.

View Loyalsoldier's full-sized avatar
:octocat:

Loyalsoldier Loyalsoldier

:octocat:
View GitHub Profile
@superbrothers
superbrothers / release.yaml
Last active October 28, 2023 15:01
Create a GitHub Release and upload multiple assets in GitHub Actions
name: Release
on:
push:
tags: ["v*"]
jobs:
run:
runs-on: ubuntu-latest
steps:
[user]
email = john.smith@gmail.com
name = John Smith
[push]
default = simple
[alias]
co = checkout
ci = commit
czp = cz && git pu
st = status
@ZE3kr
ZE3kr / IP Service for Cloudflare Worker.js
Last active January 2, 2020 23:08
Demo: https://api.tloxygen.com/ip (Use Cloudflare by default, UPYUN for China) or http://api.tloxygen.net/ip (Only use Cloudflare)
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
async function fetchAndApply(request) {
if(request.url === 'https://api.tloxygen.com/ip' || request.url === 'http://api.tloxygen.com/ip') {
const ip = request.headers.get('cf-connecting-ip')
return new Response(ip)
} else if (request.url === 'https://api.tloxygen.com/country' || request.url === 'http://api.tloxygen.com/country') {
const ip = request.headers.get('cf-ipcountry')
@xiaolai
xiaolai / markdownhere.css
Created July 2, 2016 12:12
markdown-here-css
.markdown-here-wrapper {
font-size: 16px;
line-height: 1.8em;
letter-spacing: 0.1em;
}
pre, code {
font-size: 14px;
font-family: Roboto, 'Courier New', Consolas, Inconsolata, Courier, monospace;
@ufologist
ufologist / autoplay-audio-ios.html
Created December 3, 2015 03:55
在 iOS 微信浏览器中自动播放 HTML5 audio(音乐) 的正确方式
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>Auto play html audio in iOS WeChat InAppBrowser the right way</title>
</head>
<body>
<h1>在 iOS 微信浏览器中自动播放 HTML5 audio(音乐) 的正确方式</h1>
<p>核心原理: 在微信的JS-API 中 play 一下 audio 即可达到自动播放的目的(应该是微信自己做了处理)</p>
//试试用手机访问,可以看出结果哦
var ua = navigator.userAgent;
isAndroid = /Android/i.test(ua);
isBlackBerry = /BlackBerry/i.test(ua);
isWindowPhone = /IEMobile/i.test(ua);
isIOS = /iPhone|iPad|iPod/i.test(ua);
isMobile = isAndroid || isBlackBerry || isWindowPhone || isIOS;
if(isAndroid) isMobile = 'android';
if(isBlackBerry) isMobile = 'BlackBerry';