Skip to content

Instantly share code, notes, and snippets.

View no13bus's full-sized avatar
🎯
Focusing

DanielJia no13bus

🎯
Focusing
View GitHub Profile
@no13bus
no13bus / crawler.py
Last active June 15, 2016 07:41
模拟登录带有验证码的登录页面
from bs4 import BeautifulSoup
import requests
from PIL import image
import pytesseract
mysession = requests.Session()
url = 'http://110.249.223.91/hbhb/Default.aspx'
r = mysession.get(url,timeout=60*4)
c = r.content
mysoup = BeautifulSoup(c)
@no13bus
no13bus / unsplash.py
Last active August 29, 2015 14:06 — forked from miantiao-me/unsplash.py
# -*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
# unsplash 全站下载脚本
# 请先安装 requests ,BeautifulSoup
# pip install requests beautifulsoup4
# 运行 python unsplash.py
# 输入最小页数和最大页数
@no13bus
no13bus / proxies
Last active August 29, 2015 14:07
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
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)
@no13bus
no13bus / toutiao.py
Last active August 29, 2015 14:27
toutiao api
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')
@no13bus
no13bus / index.html
Last active September 16, 2015 14:22
Simples MVVM Example with Javascript
<!--
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>
@no13bus
no13bus / StreamTest.java
Last active December 20, 2022 12:14
check a json list is sorted or not
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;
@no13bus
no13bus / boilerplatesimpledjangoninja.sh
Created August 26, 2023 16:01 — forked from liviocunha/boilerplatesimpledjangoninja.sh
Boilerplate Simple Django Ninja
# 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
@no13bus
no13bus / ContentView.swift
Created September 22, 2023 12:02
ContentView
//
// ContentView.swift
// Example-iOS
//
// Created by Alex.M on 26.05.2022.
//
import SwiftUI
//
// ContentView.swift
// Example-iOS
//
// Created by Alex.M on 26.05.2022.
//
import SwiftUI
class Visible: ObservableObject {