Skip to content

Instantly share code, notes, and snippets.

View growvv's full-sized avatar

Growvv growvv

View GitHub Profile
import json
import requests
from urllib.parse import quote, unquote
import os
def down_pic(pic_urls):
"""给出图片链接列表, 下载所有图片"""
for i, pic_url in enumerate(pic_urls):
try:
pic = requests.get(pic_url, timeout=15)
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="http://apps.bdimg.com/libs/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js" type="text/javascript"></script>
<script src="http://apps.bdimg.com/libs/bootstrap/3.3.4/js/bootstrap.min.js" type="text/javascript"></script>
</head>
  知乎还没有倒闭……
  Zhihu.com haven't closed down today... 😔

2020-10-29 19:06 +0000

//
// ViewController.swift
// ExampleUIWebView
//
// Created by admin on 2020/11/22.
//
import UIKit
import WebKit
@growvv
growvv / SimpleAlert.swift
Created November 22, 2020 04:31 — forked from BalajiMalliswamy/SimpleAlert.swift
Exploring UIAlertController in Swift
/**
Simple Alert
- Show alert with title and alert message and basic two actions
*/
func showSimpleAlert() {
let alert = UIAlertController(title: "Sign out?", message: "You can always access your content by signing back in", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.default, handler: { _ in
//Cancel Action
}))
@growvv
growvv / UITableView_Demo.swift
Created November 22, 2020 10:19
表格控件简单示例。在主ViewCOntroller中实现UITableViewDataSource和UITableViewDelegate协议
import UIKit
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
var ctrlnames: [String]?
var tableView: UITableView?
override func loadView() {
super.loadView()
@growvv
growvv / DetailViewController.swift
Created November 24, 2020 12:52
创建一个页面:由于已经用storyboard绘制好,只需要给相应变量赋值即可
//
// DetailViewController.swift
// Swift-TableView-Example
//
// Created by Bilal ARSLAN on 12/10/14.
// Copyright (c) 2014 Bilal ARSLAN. All rights reserved.
//
import Foundation
import UIKit
@growvv
growvv / MoreViewController.swift
Last active November 25, 2020 02:30
制作一个页面:通过url请求
import Foundation
import UIKit
class MoreViewController: UIViewController {
@IBOutlet var webView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
@growvv
growvv / RecipesTableViewController.swift
Last active November 25, 2020 02:41
定义一个UITableViewController,并实现UITableViewDataSource、UITableViewDelegate协议中的方法
import UIKit
class RecipesTableViewController: UITableViewController {
var recipes = Recipe.createRecipes()
let identifier: String = "tableCell"
override func viewDidLoad() {
super.viewDidLoad()
setupUI()