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
/// This is one of two sources of DB migrations. | |
/// The other one is pure SQL files found in the `migrations/` folder. | |
/// This module contains migrations made with Rust code. | |
use diesel::connection::BoxableConnection; | |
use diesel::migration::{Result as MResult, *}; | |
use diesel::pg::Pg; | |
use diesel_migrations::EmbeddedMigrations; | |
use std::fmt::*; | |
mod scan_scope; |
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
use std::task::{Context, Poll}; | |
use futures_util::future::{ok, FutureExt, LocalBoxFuture, Ready}; | |
use actix_web::{ | |
body::{Body, ResponseBody}, | |
dev::{Service, ServiceRequest, ServiceResponse, Transform}, | |
error::{Error, Result}, | |
}; | |
use serde_json::json; |
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
impl ::pdf::object::Object for Catalog { | |
fn serialize<W: ::std::io::Write>(&self, out: &mut W) -> ::std::io::Result<()> { | |
writeln!(out, "<<")?; | |
write!(out, "{} ", "Pages")?; | |
self.pages.serialize(out)?; | |
writeln!(out, "")?; | |
write!(out, "{} ", "Names")?; | |
self.names.serialize(out)?; | |
writeln!(out, "")?; | |
write!(out, "{} ", "StructTreeRoot")?; |
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
#[macro_use] extern crate unixbar; | |
extern crate systemstat; | |
use unixbar::*; | |
use systemstat::{System, Platform, ByteSize}; | |
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
#[macro_use] extern crate unixbar; | |
extern crate systemstat; | |
use unixbar::*; | |
use systemstat::{System, Platform, ByteSize}; | |
const BGS: &'static [&'static str] = &["#111111", "#1F4B17", "#111111", "#497933"]; | |
const BGS_c: &'static [&'static str] = &["#111111", "#"]; | |
// Colors for center | |
const FG_WINGS: &'static str = "#ffaacc"; |
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
use std::sync::mpsc::Sender; | |
use std::time::Duration; | |
use std::thread; | |
use std::sync::{Arc, RwLock}; | |
use super::base::Widget; | |
use format::data::Format; | |
use std::fs::File; | |
use std::io::{Read, Seek, SeekFrom}; | |
pub struct BatteryState { |
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
#!/usr/bin/env run-cargo-script | |
//! ```cargo | |
//! [dependencies] | |
//! unixbar = "0" | |
//! systemstat = "0" | |
//! ``` | |
#[macro_use] extern crate unixbar; | |
extern crate systemstat; | |
use unixbar::*; |
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
println!("DEBUG PARAMS {:?}", params.as_ref().unwrap()); | |
println!("DEBUG DATA(len: {}): {:?}", out.len(), &out); | |
assert!(out.len() % (columns+1) == 0); | |
// Then unfilter (PNG) | |
let input = out; | |
let mut out = Vec::<u8>::new(); | |
out.resize(input.len() / (columns+1) * columns, 0); // One less byte per row | |
if predictor > 10 { |