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 clap::Parser; | |
use nix::fcntl::{open, OFlag}; | |
use nix::sys::epoll::{epoll_create, epoll_ctl, epoll_wait, EpollEvent, EpollFlags, EpollOp}; | |
use nix::sys::stat::Mode; | |
use std::collections::HashMap; | |
#[derive(Parser, Debug)] | |
#[clap(author, version, about, long_about = None)] | |
pub struct Cli { | |
#[clap(value_delimiter = ' ', num_args = 1..)] |
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 nix::libc::{F_SETOWN, STDIN_FILENO}; | |
use nix::sys::signal::{SigSet, Signal, SigHandler, SigAction, SaFlags, sigaction}; | |
use nix::unistd::{getpid, read}; | |
use std::sync::atomic::{AtomicBool, Ordering}; | |
use std::thread; | |
use std::time::Duration; | |
use nix::fcntl::fcntl; | |
static SIGNAL_RECEIVED: AtomicBool = AtomicBool::new(false); |
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 chrono::{Datelike, NaiveDate, NaiveDateTime}; | |
use std::error::Error; | |
use std::fs; | |
use std::path::{Path, PathBuf}; | |
use std::string::ToString; | |
use chrono::prelude::{DateTime, Utc}; | |
use console::{style, Emoji}; | |
use regex::Regex; | |
use walkdir::WalkDir; |
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
#![no_std] | |
#![no_main] | |
use arduino_hal::hal::port::{PD3, PD5, PD6}; | |
use arduino_hal::pac::TC0; | |
use arduino_hal::port::mode::{Analog, Input, Output, PwmOutput}; | |
use arduino_hal::port::{mode, Pin, PinOps}; | |
use arduino_hal::prelude::*; | |
use arduino_hal::simple_pwm::{IntoPwmPin, PwmPinOps, Timer0Pwm, Timer2Pwm}; | |
use arduino_hal::{DefaultClock, Peripherals, Pins, Usart}; |
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 time | |
import requests | |
""" Develop an asynchronous REST API with any Python Framework you like. """ | |
BONUS_POINTS = False | |
def test_api(): |
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
#!/bin/bash | |
# compiles python3.10 on centos 7 | |
# sebsch 2022-02-02 | |
yum groupinstall development -y | |
yum install wget zlib-devel gcc openssl-devel bzip2-devel libffi-devel xz-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel expat-devel -y | |
cd ~ | |
echo "INSTALL python3.10" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Hello API!</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.6.2/css/bulma.min.css"> | |
<script src="https://unpkg.com/vue@next"></script> | |
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script> |
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 app = Vue.createApp({ | |
data: function () { | |
return { | |
output: null | |
} | |
} | |
}) | |
app.component('poll-button', { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Hello API!</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.6.2/css/bulma.min.css"> | |
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script> | |
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script> |
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
extern crate tokio; | |
use std::fs; | |
use std::path::{Path, PathBuf}; | |
use std::os::linux::fs::MetadataExt; | |
use tokio::fs::File; | |
use tokio::io::AsyncReadExt; | |
use tokio::time::{sleep, Duration}; | |
use log::{info, LevelFilter}; | |
use simple_logger::SimpleLogger; |
NewerOlder