See this issue.
Docker best practise to Control and configure Docker with systemd.
-
Create
daemon.json
file in/etc/docker
:{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
@objc(PSTArchitecture) class Architecture: NSObject { | |
/// Check if process runs under Rosetta 2. | |
/// | |
/// Use to disable tests that use WebKit when running on Apple Silicon | |
/// FB8920323: Crash in WebKit memory allocator on Apple Silicon when iOS below 14 | |
/// Crash is in JavaScriptCore: bmalloc::HeapConstants::HeapConstants(std::__1::lock_guard<bmalloc::Mutex> const&) | |
@objc class var isRosettaEmulated: Bool { | |
// Issue is specific to Simulator, not real devices | |
#if targetEnvironment(simulator) | |
return processIsTranslated() == EMULATED_EXECUTION |
// | |
// CAAnimation+BlockCallback.swift | |
// | |
import UIKit | |
// | |
// Modified from http://onedayitwillmake.com/blog/2016/06/caanimation-completion-callback-block/ | |
// Updated for Swift 4 syntax | |
// All credit to the original author (Mario Gonzalez) |
import Foundation | |
/// A class that keeps a weakly reference for `self` when implementing `onXXX` behaviors. | |
/// Instead of remembering to keep `self` as weak in a stored closure: | |
/// | |
/// ```swift | |
/// // MyClass.swift | |
/// var onDone: (() -> Void)? | |
/// func done() { | |
/// onDone?() |
See this issue.
Docker best practise to Control and configure Docker with systemd.
Create daemon.json
file in /etc/docker
:
{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
import UIKit | |
final class CustomIntensityVisualEffectView: UIVisualEffectView { | |
/// Create visual effect view with given effect and its intensity | |
/// | |
/// - Parameters: | |
/// - effect: visual effect, eg UIBlurEffect(style: .dark) | |
/// - intensity: custom intensity from 0.0 (no effect) to 1.0 (full effect) using linear scale | |
init(effect: UIVisualEffect, intensity: CGFloat) { | |
theEffect = effect |
#!/bin/bash | |
# update_gfwlist.sh | |
# Author : VincentSit | |
# Copyright (c) http://xuexuefeng.com | |
# | |
# Example usage | |
# | |
# ./whatever-you-name-this.sh | |
# | |
# Task Scheduling (Optional) |
#!/bin/bash | |
checkExisting(){ | |
echo "Checking if already existing device on file..." | |
while read fileLine; do | |
if [ "$line" = "$fileLine" ]; then | |
echo "[WARNING] Device already initialized on this system. Nothing to do here" |
#!/bin/bash | |
# | |
# 通过对比 ping 响应时间,找到本机最快的上传ip | |
# Travis@fir.im | |
# | |
# 使用方法: | |
# sh -c "$(curl -sSL https://gist.githubusercontent.com/trawor/5dda140dee86836b8e60/raw/turbo-qiniu.sh)" | |
echo "# 这个脚本理论上可以帮你获取任意域名的最快速的IP" | |
echo "# 获取IP列表的服务由 17ce.com 提供, 非常感谢有这么好的免费服务!" |
git config --global https.proxy http://127.0.0.1:1080 | |
git config --global https.proxy https://127.0.0.1:1080 | |
git config --global --unset http.proxy | |
git config --global --unset https.proxy | |
npm config delete proxy |
var mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |