This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import MapKit | |
struct Point: Identifiable { | |
var id = UUID() | |
var latitude, longitude: Double | |
func coordinate() -> CLLocationCoordinate2D { | |
CLLocationCoordinate2D(latitude: latitude, longitude: longitude) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Howto | |
# 1. Install pkgs by run `opkg install ca-bundle openssl-util libustream-openssl` | |
# 1. Upload this script to your OpenWRT router. | |
# 2. Save as /etc/hotplug.d/iface/99-ddns. | |
# 3. Replace the VARIABLES below. | |
# 4. Enjoy! | |
# variables should be changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"errors" | |
"fmt" | |
"golang.org/x/net/icmp" | |
"golang.org/x/net/ipv4" | |
"net" | |
"os" | |
"regexp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<source> | |
@type forward | |
port 24224 | |
</source> | |
<filter docker.**> | |
@type record_transformer | |
<record> | |
log ${time} ${record["container_name"]} ${record["log"]} | |
</record> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"os" | |
"gopkg.in/src-d/go-billy.v3" | |
"gopkg.in/src-d/go-billy.v3/memfs" | |
"gopkg.in/src-d/go-git.v4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import( | |
"fmt" | |
"os" | |
"image" | |
"image/jpeg" | |
"image/draw" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cousera课程《用Python玩转数据 Data Processing Using Python》第4.2章编程作业《男女电影评分差异分析编程》 | |
# | |
#分析数据集,找出男性女性用户评分的标准差,并输出两位小数部分 | |
#提示:先分别计算每个人电影评分的平均分,再按性别求标准差 | |
#使用方法: | |
# python work.py > result.txt | |
import pandas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#说明: | |
# 在Ubuntu中,Docker在pull image时,所使用的CA证书和ubuntu系统的一致。 | |
# 所以,要想docker pull时使用自己的CA证书签名的证书,最简单的方式就是在系统中添加CA。 | |
# 当然,Docker文档中也提到了一些仅仅添加到Docker(而不是全系统)的方式,实测下来貌似没用。 | |
# 直接将CA添加到Ubuntu系统中,并让Docker pull生效,需要三个步骤 | |
# 第一步,添加CA文件,注意,这里目标文件名必须以crt结束 | |
cp path/to/your_ca.crt /usr/local/share/ca-certificates/xxx.crt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
# Place into Rails.root/config/initializers | |
Rails::Rack::Logger.class_eval do | |
def call_with_quiet_assets(env) | |
previous_level = Rails.logger.level | |
Rails.logger.level = Logger::FATAL if env['PATH_INFO']=="/silence/request" | |
call_without_quiet_assets(env).tap do | |
Rails.logger.level = previous_level | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
openssl pkcs12 -in source.p12 -clcerts -nodes |
NewerOlder