Skip to content

Instantly share code, notes, and snippets.

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) => {
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
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
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
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
'use strict'
class Channel {
constructor(buffer) {
if (!buffer) this.buffer = 1
else this.buffer = buffer
this.data = []
this.putPromiseResolve = null
this.getPromiseResolve = null
'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
// 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
// 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
@paruljain
paruljain / vagrantfile
Created February 14, 2017 15:34
Vagrantfile for 3 Alpine Linux VMs with Minio Server
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