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' => |
var crypto = require('crypto'); | |
var key = 'MySecretKey12345'; | |
var iv = '1234567890123456'; | |
var cipher = crypto.createCipheriv('aes-128-cbc', key, iv); | |
var decipher = crypto.createDecipheriv('aes-128-cbc', key, iv); | |
var text = 'plain text'; | |
var encrypted = cipher.update(text, 'utf8', 'binary'); | |
encrypted += cipher.final('binary'); | |
hexVal = new Buffer(encrypted, 'binary'); |