Run Raspberry 3 in digital signage mode with Chromium Web browser on a TV screen
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 crate contains various macros and functions for the Rust programming language. | |
#[macro_export] | |
macro_rules! runtime_globals { | |
( $($constant:meta => $value:meta $(; $fallback_value:expr )? $(,)? )* ) => { | |
$( | |
::paste::paste! { | |
#[::lazy_fn::lazy_fn] | |
fn [< lazy_fn_ $constant:lower >]() -> &'static str { |
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
#![feature(allocator_api, core_io_borrowed_buf, read_buf)] | |
#![allow(unused)] | |
#[rustfmt::skip] | |
use { | |
tmfalloc as tm, | |
std::{ | |
cmp, | |
io::{prelude::*, BorrowedRef, ErrorKind}, | |
path::Path, | |
}, |
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 python | |
import textwrap | |
from string import Template | |
def template(dir: str, full_pkg: str, ver: str = "0.1.0") -> str: | |
backslash = '\\' | |
backslash_newline = '\\n' | |
pkg_src = full_pkg + '_SOURCES=' + full_pkg + '.c' | |
it = textwrap.dedent('''\ | |
#!/bin/bash |
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
// ==UserScript== | |
// @name Cookie-Clicker for Alley Eddys | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description answsers requests from customers | |
// @author Me | |
// @require https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/7.21.2/babel.min.js | |
// @require https://cdnjs.cloudflare.com/ajax/libs/Detect.js/2.2.2/detect.min.js | |
// @run-at document-idle | |
// @match https://mystore.allenedmonds.com/backoffice |
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 python3 | |
# Use version 3.11.6 | |
import click | |
import os | |
import time | |
@click.command() | |
@click.option('--model', default='openai/whisper-base', help='ASR model to use for speech recognition. Default is "openai/whisper-base". Model sizes include base, small, medium, large, large-v2. Additionally, try appending ".en" to model names for English-only applications (not available for large).') | |
@click.option('--device', default='cuda:0', help='Device to use for computation. Default is "cuda:0". If you want to use CPU, specify "cpu".') | |
@click.option('--dtype', default='float32', help='Data type for computation. Can be either "float32" or "float16". Default is "float32".') |
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 | |
cwd=$(dirname $(readlink -f $0)) | |
checkpoint_dir="$cwd/backup" | |
mkdir -p "$checkpoint_dir" | |
infix=$(date '+%F_%T') | |
output="$checkpoint_dir/checkpoint-$infix.tar" | |
tar \ | |
--exclude='dist' \ | |
--exclude='__pycache__' \ | |
--exclude='node_modules' \ |
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
To | From | Method | |
---|---|---|---|
string of code | literal code | std::stringify!{} | |
string of code | syntax tree | !quote(#syntax_tree).to_string() | |
string of code | TokenStream | .to_string() | |
string of syntax | literal code | format!("{:?}",parse2::<SynType>(quote! {...}).expect(...) | |
string of syntax | syntax tree | format!("{:?}"),…), format!("{:#?}"),…) | |
string of tokens | literal code | format!("{:?}",quote! {...}) | |
string of tokens | TokenStream | format!("{:?}"),…), format!("{:#?}"),…) | |
syn::Error | TokenStream | .to_compile_error() [see Rule #7] | |
syntax tree | literal code | parse_quote!(…) |
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
function crunchtime(input) { | |
// time should be a delta from some time Xa-Ya, | |
// Xa-Y, Xp-Yp | |
// This function parses the first non-numeric character | |
// as an indication of whether it's receiving AM or PM, | |
// followed by a `-` to delimit between the starting time | |
// and ending time. Our expected inputs, less formally, resemble | |
// 4:45a-11a, 5p-12:30p, 6:45a-2p | |
input = input.trim(); | |
if (input.toLowerCase() == "off") { |
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::io::Write; | |
use std::{env, path::Path}; | |
use std::{fs::OpenOptions, path::PathBuf}; | |
use regex::Regex; | |
fn main() { | |
let dir = Path::new(&env::var("CARGO_MANIFEST_DIR").unwrap()).join("lib"); | |
println!("cargo:rustc-link-search=native={}", dir.display()); |
NewerOlder