This goes with the Traversy Media Scrapy tutorial on YouTube
pip install scrapy
| // serverless/stages/serverless.js | |
| const { Component } = require('@serverless/core'); | |
| const required = (name) => { | |
| throw new Error(`An argument "${name}" is required.`); | |
| }; | |
| const processRef = (value, data) => { | |
| for (const key in data) { |
This goes with the Traversy Media Scrapy tutorial on YouTube
pip install scrapy
| // from codepad | |
| var Mocha = require('mocha') | |
| var mocha = new Mocha() | |
| mocha.suite.emit('pre-require', this, 'solution', mocha) | |
| var assert = require("chai").assert; | |
| var transacts = [ | |
| { |
| const util = require('util') | |
| const mysql = require('mysql') | |
| const pool = mysql.createPool({ | |
| connectionLimit: 10, | |
| host: 'localhost', | |
| user: 'root', | |
| password: 'password', | |
| database: 'my_database' | |
| }) |
| import boto3 | |
| from datetime import datetime, timedelta | |
| from operator import itemgetter | |
| import smtplib | |
| from email.mime.text import MIMEText | |
| AccessKey = "Your Access Key" | |
| SecretKey = "Your Secret Key" |
Windows Service with Python 3.5 and pyinstaller
Mocha is a unittest framework for Node. In this document, we explain how you can test your javascript code and also your HTTP servers.
Use npm to install Mocha:
npm install mocha| # | |
| # Verify captcha | |
| $post_data = http_build_query( | |
| array( | |
| 'secret' => CAPTCHA_SECRET, | |
| 'response' => $_POST['g-recaptcha-response'], | |
| 'remoteip' => $_SERVER['REMOTE_ADDR'] | |
| ) | |
| ); | |
| $opts = array('http' => |
| /* Useful celery config. | |
| app = Celery('tasks', | |
| broker='redis://localhost:6379', | |
| backend='redis://localhost:6379') | |
| app.conf.update( | |
| CELERY_TASK_RESULT_EXPIRES=3600, | |
| CELERY_QUEUES=( | |
| Queue('default', routing_key='tasks.#'), |