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 AVKit | |
struct CameraView: UIViewRepresentable { | |
var frameSize: CGSize | |
@Binding var session: AVCaptureSession | |
func makeUIView(context: Context) -> UIView { | |
let view = UIViewType(frame: CGRect(origin: .zero, size: frameSize)) | |
view.backgroundColor = .clear | |
let cameraLayer = AVCaptureVideoPreviewLayer(session: session) |
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 | |
struct Line { | |
var points: [CGPoint] | |
} | |
struct ZoomDragView: View { | |
@State private var scale = 1.0 | |
@State private var lastScale = 1.0 |
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
// | |
// ContentView.swift | |
// Example-iOS | |
// | |
// Created by Alex.M on 26.05.2022. | |
// | |
import SwiftUI | |
class Visible: ObservableObject { |
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
// | |
// ContentView.swift | |
// Example-iOS | |
// | |
// Created by Alex.M on 26.05.2022. | |
// | |
import SwiftUI | |
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
# V 0.0.3 | |
# 2021-05-05 | |
# Shell script to create a very simple Django Ninja project. | |
# This script require Python 3.x and pyenv | |
# Settings.py is config to Django 3.1.5 and Django Ninja 0.12.1 | |
# The project contains: | |
# Settings config | |
# Admin config |
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 com.usersapi; | |
import com.alibaba.fastjson.JSONArray; | |
import java.io.InputStream; | |
import java.util.Comparator; | |
import java.util.Date; | |
import java.util.List; | |
import java.util.Objects; |
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
<!-- | |
English: | |
This example show how do a simple MVVM code with html+js | |
You can change the data in design and the object person will be changed, you can too make the change by the console(js) of the property from the object and the visual will be changed. | |
Portugues: | |
Esse exemplo mostra como fazer um simples MVVM framework com HTML e JS | |
Você pode alterar os dados visualmente e o objeto pessoa vai ser alterado e também se você fizer a alteração via console da propriedade o visual será modificado. | |
--> | |
<!DOCTYPE html> | |
<html> |
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 | |
import datetime | |
from bs4 import BeautifulSoup | |
def get_posts_by_day(date_str) | |
url='http://toutiao.io/prev/%s' % date_str | |
r=requests.get(url) | |
c=r.content | |
soup = BeautifulSoup(c) | |
posts=soup.find_all('div', 'post') |
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
class models_a(models.Model): | |
value_a = models.FloatField(default=0.0) | |
value_a_1 = models.FloatField(default=0.0) | |
class models_b(models.Model): | |
foreign = models.ForeignKey(models_a) | |
value_b = models.FloatField(default=0.0) | |
####进行更新model_b里面的字段value_b,让他的值等于models_a里面的value_a和value_a_1和value_b这三个值之和 | |
results = models_b.objects.exclude(value_b=0.0) |
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 requesocks as requests | |
session = requests.session() | |
session.proxies = {'http': 'socks5://127.0.0.1:7070','https': 'socks5://127.0.0.1:7070'} | |
s=session.get('https://www.facebook.com') | |
print s |
NewerOlder