Skip to content

Instantly share code, notes, and snippets.

View InTEGr8or's full-sized avatar
😊
Always Be Coding

Mark Stouffer InTEGr8or

😊
Always Be Coding
View GitHub Profile
# Full text search
[hendry@t480s 5xx]$ cat bugzilla.sh
aws --profile uneet-dev logs filter-log-events --log-group-name bugzilla --start-time $(date -d "-1 hour" +%s000) \
--filter-pattern '"apex/ping/v1.0"'
# (faster) Query on a JSON structured log
[hendry@t480s 5xx]$ cat alambda.sh
aws --profile uneet-demo logs filter-log-events --log-group-name "/aws/lambda/alambda_simple" --start-time $(date -d "-8
@CMCDragonkai
CMCDragonkai / rust_composition.rs
Last active January 30, 2022 07:11
Rust: Function Composition (Rust 1.9 nightly) (credit to https://www.youtube.com/watch?v=ZP93Ngeokio)
#![feature(box_syntax)]
// function composition is not part of the standard library
// see discussion here: https://internals.rust-lang.org/t/function-composition-in-the-standard-library/2615/11
fn main() {
// works on top-level functions, the 'a lifetime is static
// we need debugging display since we're displaying the Option monad, a wrapped type
println!("{:?}", compose(convert_string_to_float, double_float)(Some("2".to_string())));
//Accepts a date string and returns a date string formatted for Kendo DatePickers
function dateForKendo(date) {
return kendo.toString(kendo.parseDate(date), 'MM/dd/yyyy');
}
<#
.SYNOPSIS
Resize an image
.DESCRIPTION
Resize an image based on a new given height or width or a single dimension and a maintain ratio flag.
The execution of this CmdLet creates a new file named "OriginalName_resized" and maintains the original
file extension
.PARAMETER Width
The new width of the image. Can be given alone with the MaintainRatio flag
.PARAMETER Height