Skip to content

Instantly share code, notes, and snippets.

View zhuqling's full-sized avatar

zhuqling zhuqling

  • @xinsailei
  • Guangzhou
View GitHub Profile
@zhuqling
zhuqling / URL Schemes.md
Created August 30, 2022 09:30 — forked from zhuziyi1989/URL Schemes.md
常用 URL Schemes 收集。

关于 URL Scheme 你知道多少?

iOS系统中

由于苹果的各应用都是在沙盒中,不能够互相之间访问或共享数据。但是苹果还是给出了一个可以在APP之间跳转的方法:URL Scheme。简单的说,URL Scheme就是一个可以让 APP 相互之间可以跳转的协议。每个 APP 的URL Scheme都是不一样的,如果存在一样的URL Scheme,那么系统就会响应先安装那个 APP 的URL Scheme,因为后安装的 APP 的URL Scheme被覆盖掉了,是不能被调用的。

Android系统中

Android中的 Scheme 是一种页面内跳转协议,是一种非常好的实现机制,通过定义自己的 Scheme 协议,可以非常方便跳转app中的各个页面;通过scheme协议,服务器可以定制化告诉App跳转那个页面,可以通过通知栏消息定制化跳转页面,可以通过H5页面跳转页面等。 URL Scheme 就如同网页的url链接一样,可以打开App或跳转到相应的页面。但是大部分APP没有公开自己的URL Scheme。

@zhuqling
zhuqling / _chrome-ext-auth-identity.md
Created November 12, 2021 01:23 — forked from raineorshine/_chrome-ext-auth-identity.md
How to set up user authentication for a Chrome Extension using the Chrome Identity API

How to set up user authentication for a Chrome Extension using the Chrome Identity API

  1. Create a private key file, from which you can create the manifest key and Application ID, as detailed here: https://stackoverflow.com/questions/23873623/obtaining-chrome-extension-id-for-development
  2. Add the manifest key to "key" in manifest.json
  3. Create a new project in Google Developer Console https://console.developers.google.com/project
  4. Go to "APIs & auth > Credentials" and create new client id for a Chrome Application using the Application ID generated in step 3.
  5. Copy the Client ID to oauth2.client_id in the manifest.json

Deprecated?

@zhuqling
zhuqling / ArcTextLayer.swift
Created May 13, 2019 23:41 — forked from cemolcay/ArcTextLayer.swift
Draws a curved string on a CALayer with angle, radius and text that you give.
import UIKit
// swift port of stackoverflow answer
// http://stackoverflow.com/a/31301238/2048130
extension CGFloat {
/** Degrees to Radian **/
var degrees: CGFloat {
return self * (180.0 / .pi)
}
@zhuqling
zhuqling / FontInstaller.py
Created December 20, 2018 05:08 — forked from omz/FontInstaller.py
FontInstaller
# FontInstaller (by @olemoritz)
# This script installs a custom TTF font on iOS (system-wide).
# It can be used in one of two ways:
# 1. Simply run it in Pythonista, you'll be prompted for the URL of the font
# you'd like to install (if there's a URL in the clipboard, it'll be used by default)
# 2. Use it as an 'Open in...' handler, i.e. select this file in Pythonista's 'Open in...
# menu' setting. This way, you can simply download a ttf file in Safari and open it in
//jweixin-1.0.0.js
! function(g, initFunc) {
'function' == typeof define && (define.amd || define.cmd) ? define(function() {
return initFunc(g)
}) : initFunc(g, true)
}(this,
function(glob, setGlobal) {
function invokeCmd(cmd, param, callbackObj) {
glob.WeixinJSBridge ? WeixinJSBridge.invoke(cmd, normParameter(param), function(res) {
completeBridgeInteraction(cmd, res, callbackObj);
var CryptoJS = require('crypto-js')
var request = require('request-promise')
/*
* npm install crypto-js request-promise
* node wx_t1t_hack.js
*/
// export function testEncription(msg, fullKey) {
// var fullKey = fullKey.slice(0, 16)
@zhuqling
zhuqling / unwxapkg.py
Created January 2, 2018 06:38 — forked from thedreamwork/unwxapkg.py
unpack wxapkg
#!/usr/bin/python
# usage python unwxapkg.py filename
import sys,os
import struct
class WxapkgFile:
nameLen = 0
name = ""
@zhuqling
zhuqling / IPSecDemo.m
Created May 26, 2016 07:54 — forked from duoduoyi/IPSecDemo.m
Start IPSec programmatically in iOS 8
- (void)viewDidLoad
{
[super viewDidLoad];
// init VPN manager
self.vpnManager = [NEVPNManager sharedManager];
// load config from perference
[_vpnManager loadFromPreferencesWithCompletionHandler:^(NSError *error) {
@zhuqling
zhuqling / ovpn-writer.sh
Created May 26, 2016 07:38 — forked from renatolfc/ovpn-writer.sh
Script to generate an OpenVPN client configuration file in the unified format
#!/bin/sh
##
## Usage: ./ovpn-writer.sh SERVER CA_CERT CLIENT_CERT CLIENT_KEY SHARED_SECRET > client.ovpn
##
server=${1?"The server address is required"}
cacert=${2?"The path to the ca certificate file is required"}
client_cert=${3?"The path to the client certificate file is required"}
client_key=${4?"The path to the client private key file is required"}
@zhuqling
zhuqling / ST3: 3083 and 3103
Created March 22, 2016 06:29
ST3: 3083 and 3103
3103:
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA
93F6323C FD7F7544 3F39C318 D95E6480