This file contains 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 ESP32 | |
API_KEY = "****" | |
SSID = "****" | |
PASS = ""****" | |
i2c = I2C.new(I2C::PORT0, scl: 22, sda: 21).init(I2C::MASTER) | |
bme280 = SENSOR::BME280.new(i2c, 0x76) | |
bme280.init |
This file contains 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
#!/bin/bash | |
set -e | |
CURRENT_NAME="CurrentName" | |
CURRENT_OTP="current_name" | |
NEW_NAME="NewName" | |
NEW_OTP="new_name" |
This file contains 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
#!/bin/bash | |
sudo apt update | |
sudo apt install -y build-essential autoconf libncurses5-dev libssh-dev |
This file contains 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
let links = document.querySelectorAll( "a" ); | |
let hosts = [] | |
links.forEach ( (l) => { hosts.push(l.host.replace("www.", ""))}) | |
const domains = new Set(hosts) | |
domains.join("\n") |
This file contains 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
require 'socket' | |
server = TCPSocket.open(ENV.fetch('APAS_TCP_SERVER', 'localhost'), | |
ENV.fetch('APAS_TCP_PORT', '4040')) | |
ready = server.gets(5) | |
puts ready | |
loop do | |
msg = rand > 0.1 ? "AT_pour_amb=#{100 + rand(200).to_i};" : 'AT_bottle_changed=1;' | |
server.print(msg) | |
puts msg |
This file contains 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
'''Neural style transfer with Keras. | |
Before running this script, download the weights for the VGG16 model at: | |
https://drive.google.com/file/d/0Bz7KyqmuGsilT0J5dmRCM0ROVHc/view?usp=sharing | |
(source: https://gist.github.com/baraldilorenzo/07d7802847aaad0a35d3) | |
and make sure the variable `weights_path` in this script matches the location of the file. | |
Run the script with: | |
``` | |
python neural_style_transfer.py path_to_your_base_image.jpg path_to_your_reference.jpg prefix_for_results |
This file contains 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
INPUT_VIDEO=$1 | |
VIDEO_LENGTH="$(ffprobe -i input.mp4 -show_format | grep duration | sed 's/[A-Za-z=]*//g')" | |
ffmpeg -i $INPUT_VIDEO -vf fps=40/$VIDEO_LENGTH out/frame%02d.jpg |
This file contains 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
photo_timestamp=$(date +%Y-%m-%d_%H%M) | |
fswebcam -r 1280x720 --jpeg 100 -D 3 -S 13 "${photo_timestamp}.jpg" | |
aws s3 cp "$photo_timestamp.jpg" "s3://$s3_bucket" && \ | |
aws s3 cp "$photo_timestamp.jpg" "s3://$s3_bucket/latest.jpg" --acl public-read && \ | |
rm "$photo_timestamp.jpg" |
This file contains 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
defmodule JSON do | |
import String | |
def parse( content ) do | |
case parse_content(content) do | |
{ value, "" } -> value | |
{ _, _ } -> raise "crap" | |
end | |
end |
This file contains 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
/* | |
Written by Sergei Silnov @kumekay [email protected] | |
Based on: | |
https://github.com/NicoHood/HID/wiki/Keyboard-API#boot-keyboard | |
*/ | |
#include "HID-Project.h" | |
const int pinLed = LED_BUILTIN; |