This file contains hidden or 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
func weave(left: inout [Int], right: inout [Int], temp: inout [Int], results: inout [[Int]]) { | |
if left.isEmpty || right.isEmpty { | |
var result = temp | |
result.append(contentsOf: left) | |
result.append(contentsOf: right) | |
results.append(result) | |
return | |
} | |
let leftFirst = left.removeFirst() |
This file contains hidden or 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
//We first load the express framework and make it available for our script | |
var express = require('express'); | |
//We load the pi-gpio library here | |
var gpio = require("pi-gpio"); | |
//Here we initialize the express framework | |
var app = express(); | |
//We are going to GET the pin number and the state to set the pin to from the URL from the browser |
This file contains hidden or 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
//We first load the express framework and make it available for our script | |
var express = require('express'); | |
//Here we initialize the express framework | |
var app = express(); | |
//We are going to GET the pin number and the state to set the pin to from the URL from the browser | |
//For example http://yourdomain.com/25/1 -----> This turns the state of pin number 25 to HIGH | |
//Similarly: http://yourdomain.com/25/0 -----> This turns the state of pin number 25 to LOW | |
//NOTE: We can also send a json packet to the server as part of this request, but we won't cover that for now ! |
This file contains hidden or 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
var nodemailer = require("nodemailer"); | |
for (var i= 1; i<=100; i++) { | |
// create reusable transport method | |
//(opens pool of SMTP connections) | |
var smtpTransport = | |
nodemailer.createTransport("SMTP",{ | |
service: "Gmail", | |
auth: { | |
user: "", | |
pass: "" |