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
create table tv_info( | |
id int auto_increment primary key, | |
url varchar(150), | |
type tinyint(2), | |
title varchar(50), | |
comment varchar(100), | |
status tinyint(2)); |
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
#!/usr/bin/python | |
# -*-coding: utf-8 -*- | |
import requests | |
from bs4 import BeautifulSoup | |
import pinyin | |
import mysql.connector | |
import sys | |
count_index = 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
<?php | |
use GuzzleHttp\Psr7\Request; | |
use GuzzleHttp\Client; | |
use GuzzleHttp\Pool; | |
use Monolog\Logger; | |
use Monolog\Handler\StreamHandler; | |
class PointTest extends PHPUnit_Framework_TestCase | |
{ |
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
php artisan key:generate | |
php artisan tinker | |
$plain = '123456'; | |
$hashed = app('hash')->make('123456') | |
app('hash')->check($plain, $hashed) | |
php artisan key:generate | |
app('hash')->check($plain, $hashed) |
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
<?php | |
class Task | |
{ | |
private $data = []; | |
private $fp = null; | |
private $columns = ['id', 'amount', 'date']; |
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
<?php | |
class RollNewsSpider | |
{ | |
private $url = 'http://roll.news.qq.com/interface/roll.php'; | |
public function run() | |
{ | |
$data = $this->getJsonData(); |
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
<?xml version="1.0"?> | |
<ruleset name="TestMonitor PMD ruleset" xmlns="http://pmd.sf.net/ruleset/1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" | |
xsi:noNamespaceSchemaLocation=" http://pmd.sf.net/ruleset_xml_schema.xsd"> | |
<description>TestMonitor PMD ruleset</description> | |
<rule ref="rulesets/cleancode.xml"> | |
<exclude name="StaticAccess"/> | |
</rule> |
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
<?php | |
$excluded_folders = [ | |
'node_modules', | |
'storage', | |
'vendor', | |
'bootstrap/cache', | |
]; | |
$finder = PhpCsFixer\Finder::create() | |
->in(__DIR__) | |
->exclude($excluded_folders) |
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 axios from 'axios'; | |
async function getBaidu() { | |
return axios.get('http://www.baidu.com'); | |
} | |
async function getBing() { | |
return axios.get('http://www.guazi.com'); | |
} |
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 * as puppeteer from 'puppeteer'; | |
import * as fs from 'fs'; | |
/** | |
* 使用typescript实现一个点评页面爬虫 | |
*/ | |
class DianpingDownloader { | |
private urls; | |
/** |
OlderNewer