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 requests | |
url='https://ihtcboy.com/htc.pdf' | |
r = requests.get(url, stream=True) | |
with open('C:/Users/HTC/myfile.pdf', 'wb') as f: | |
f.write(r.content) |
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
<!-- js代码语法高亮 | |
<link rel="stylesheet" href="//cdn.bootcss.com/highlight.js/9.15.8/styles/monokai-sublime.min.css"> | |
<script src="//cdn.bootcss.com/highlight.js/9.15.8/highlight.min.js"></script> | |
<script> | |
// hljs.initHighlightingOnLoad(); | |
$(document).ready(function () { | |
$('pre code').each(function (i, block) { | |
$(this).removeClass(); | |
hljs.highlightBlock(block); | |
}); |
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
static NSString *bundleTeamIdentifier(void) | |
{ | |
NSString *mobileProvisionPath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"embedded.mobileprovision"]; | |
FILE *fp=fopen([mobileProvisionPath UTF8String],"r"); | |
char ch; | |
if(fp==NULL) { | |
printf("file cannot be opened/n"); | |
return NULL; | |
} | |
NSMutableString *str = [NSMutableString string]; |
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
➜ ~ nslookup -q=TXT _netblocks.google.com 8.8.8.8 | |
Server: 8.8.8.8 | |
Address: 8.8.8.8#53 | |
Non-authoritative answer: | |
_netblocks.google.com text = "v=spf1 ip4:35.190.247.0/24 ip4:64.233.160.0/19 ip4:66.102.0.0/20 ip4:66.249.80.0/20 ip4:72.14.192.0/18 ip4:74.125.0.0/16 ip4:108.177.8.0/21 ip4:173.194.0.0/16 ip4:209.85.128.0/17 ip4:216.58.192.0/19 ip4:216.239.32.0/19 ~all" | |
Authoritative answers can be found from: | |
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
``` | |
const svg=`<svg version="1.1" baseProfile="full" width="300" height="200" | |
xmlns="http://www.w3.org/2000/svg"> | |
<rect width="100%" height="100%" fill="red" /> | |
<circle cx="150" cy="100" r="80" fill="green" /> | |
<text x="150" y="125" font-size="60" text-anchor="middle" fill="white">SVG</text></svg>` | |
svgToPng(svg,(imgData)=>{ | |
const pngImage = document.createElement('img'); | |
document.body.appendChild(pngImage); | |
pngImage.src=imgData; |
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
### QuickLook | |
~/Library/QuickLook/ | |
### macOS mobileprovision | |
~/Library/MobileDevice/Provisioning\ Profiles/ |
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
################################################################ | |
//获取当前屏幕显示的viewcontroller | |
- (UIViewController *)getCurrentVC | |
{ | |
UIViewController *result = nil; | |
UIWindow * window = [[UIApplication sharedApplication] keyWindow]; | |
if (window.windowLevel != UIWindowLevelNormal) | |
{ |
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
[使用脚本批量替换文本内容 - 技术小黑屋](https://droidyue.com/blog/2019/10/13/replace-text-in-multiple-files-using-shell-script/) | |
---- | |
很多时候,我们需要进行多个文件的查找并替换,虽然IDE有这样的可视化功能,但是偏爱终端的人还是想要尝试用脚本实现一把。如下是一个简单的脚本来实现多文件的查找替换处理。 | |
脚本内容 | |
#!/bin/sh |
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 os | |
import requests | |
# 下载m3u8格式的视频 | |
def download_m3u8(video_download_url, multimedia_path): | |
print("start download video") | |
all_content = requests.get(video_download_url).text # 获取M3U8的文件内容 | |
file_line = all_content.split("\n") # 读取文件里的每一行 | |
length = len(file_line) | |
print('video length:', length) |
NewerOlder