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
const http = require('http'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const server = http.createServer((req, res) => { | |
const url = decodeURI(req.url); | |
const filePath = path.join(__dirname, url); | |
if (req.method === 'PROPFIND') { | |
fs.readdir(filePath, (err, files) => { |
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
from aws_request_signer import AwsRequestSigner, UNSIGNED_PAYLOAD | |
import http.client | |
import queue | |
from os import scandir | |
import os | |
from urllib.parse import quote | |
from os.path import join | |
import time | |
from threading import Thread |
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
from aws_request_signer import AwsRequestSigner, UNSIGNED_PAYLOAD | |
import http.client | |
import queue | |
from os import scandir | |
import os | |
from urllib.parse import quote | |
from os.path import join | |
import time | |
from threading import Thread | |
import threading |
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
from aws_request_signer import AwsRequestSigner, UNSIGNED_PAYLOAD | |
import requests | |
import queue | |
from os import scandir | |
import os | |
from urllib.parse import quote | |
from os.path import join | |
import time | |
from threading import Thread |
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
import queue | |
from os import scandir | |
from os.path import join | |
from threading import Thread | |
import time | |
# Number of concurrent copy operations | |
MAX_THREADS = 30 | |
# Queue of files to copy to s3 |
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
'use strict' | |
class Channel { | |
constructor(buffer) { | |
if (!buffer) this.buffer = 1 | |
else this.buffer = buffer | |
this.data = [] | |
this.putPromiseResolve = null | |
this.getPromiseResolve = null |
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
'use strict' | |
const fs = require('fs'), | |
path = require('path') | |
exports.scan = function(folder) { | |
if (!folder) return | |
const stats = fs.statSync(folder) | |
if (!stats.isDirectory()) throw new Error(`${folder} is not a directory`) | |
const self = this |
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
// Include the libraries we need | |
#include <OneWire.h> | |
#include <DallasTemperature.h> | |
#include <Ticker.h> | |
#include <ESP8266WiFi.h> | |
#include <EEPROM.h> | |
#include <PubSubClient.h> | |
#include <stdlib.h> | |
//Global variables |
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
// Include the libraries we need | |
#include <OneWire.h> | |
#include <DallasTemperature.h> | |
#include <Ticker.h> | |
Ticker temperatureTicker; | |
// Data wire is plugged into port 2 on the Arduino | |
#define ONE_WIRE_BUS D2 |
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
Vagrant.configure("2") do |config| | |
(1..3).each do |i| | |
config.vm.define "node-#{i}" do |node| | |
node.vm.box = "maier/alpine-3.3.1-x86_64" | |
node.vm.synced_folder ".", "/vagrant", disabled: true | |
node.vm.network "public_network", ip: "192.168.1.3#{i}", auto_config: true | |
node.vm.provider "virtualbox" do |vb| | |
vb.name = "Alpine#{i}" | |
vb.cpus = 1 | |
vb.memory = 1024 |
NewerOlder