国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
| function mb_unserialize($string) | |
| { | |
| $recovered = preg_replace_callback( | |
| '!(?<=^|;)s:(\d+)(?=:"(.*?)";(?:}|a:|s:|b:|d:|i:|o:|N;))!s', | |
| function($match) { | |
| return 's:' . mb_strlen($match[2], '8bit'); | |
| }, | |
| $string | |
| ); |
| /** | |
| * 把从HTML源码中获取的相对路径转换成绝对路径 | |
| * @param string $url HTML中获取的网址 | |
| * @param string $URI 用来参考判断的原始地址 | |
| * @return 返回修改过的网址,如果网址有误则返回FALSE | |
| */ | |
| function filter_relative_url($url, $URI){ | |
| //STEP1: 先去判断URL中是否包含协议,如果包含说明是绝对地址则可以原样返回 | |
| if(strpos($url, '://') !== FALSE){ | |
| return $url; |
| BOOL isCurrentlyDaytime(CGFloat latitude, CGFloat longitude) | |
| { | |
| // http://users.electromagnetic.net/bu/astro/iyf-calc.php | |
| // http://aa.quae.nl/en/reken/zonpositie.html | |
| static NSUInteger const secondsPerDay = 60*60*24; | |
| static NSTimeInterval const julianLeap = 0.0009; | |
| static double const degreeToRadian = M_PI/180.0; | |
| static double const radianToDegree = 180.0/M_PI; | |
| # coding: utf-8 | |
| import re | |
| import hashlib | |
| import sys | |
| from base64 import b64encode | |
| from random import choice | |
| items = ['8', '9', 'a', 'b'] | |
| names = sys.argv |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>iOS body click 事件冒泡的 bug</title> | |
| </head> | |
| <body> | |
| <h1>点击 h1 不会冒泡到 body</h1> |
| window.Clipboard = (function(window, document, navigator) { | |
| var textArea, | |
| copy; | |
| function isOS() { | |
| return navigator.userAgent.match(/ipad|iphone/i); | |
| } | |
| function createTextArea(text) { | |
| textArea = document.createElement('textArea'); |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
| // | |
| // PHPhotoLibrary+CustomPhotoAlbum.h | |
| // dashcam_ios | |
| // | |
| // Created by hc on 2016/11/25. | |
| // Copyright © 2016年 Sunvalley. All rights reserved. | |
| // | |
| #import <Photos/Photos.h> |
| ###### CONSISTENCY BETWEEN MACOS AND IOS ##### | |
| # | |
| # In order to use the same PodFile with MacOS, we need to unlink the libraries that do not support Catalyst, filter | |
| # files in native targets build phases, filter dependencies and make sure the unsupported frameworks along with their | |
| # their bundle resources are not included in the final archive. For that, we use `platform_filter` to specify 'ios' and | |
| # 'OTHER_LDFLAGS[sdk=iphone*]' to link those libraries for iPhone and iPad. Besides, we modify "*frameworks.sh" and | |
| # "*resrouces.sh" to skip installation for architecture x86_64. | |
| # | |
| # *Notice*: 'sdk=iphone*' excludes macOS, even though Catalyst is compiled with iOS SDK. | |
| # |
| # See https://github.com/rikumi/iconsur | |
| yarn global add iconsur | |
| sudo iconsur set /Applications/Android\ File\ Transfer.app -k Airdroid | |
| sudo iconsur set /Applications/Android\ Studio.app/ -l -c 7a5 -s 0.8 | |
| sudo iconsur set /Applications/DaisyDisk.app/ -l | |
| sudo iconsur set /Applications/Decompressor.app/ -l | |
| sudo iconsur set /Applications/Discord.app/ | |
| sudo iconsur set /Applications/Google\ Chrome.app/ | |
| sudo iconsur set /Applications/IINA.app/ -l -c 161d22 |