Skip to content

Instantly share code, notes, and snippets.

View webern's full-sized avatar

Matthew James Briggs webern

View GitHub Profile
2021-04-16T19:49:58.2829250Z ##[section]Starting: Request a runner to run this job
2021-04-16T19:49:58.3336405Z Found online and idle self-hosted runner in current repository that matches the required labels: 'self-hosted , linux , x64'
2021-04-16T19:49:58.4060068Z ##[section]Finishing: Request a runner to run this job
2021-04-16T19:50:03.4876898Z Current runner version: '2.277.1'
2021-04-16T19:50:03.4879705Z Runner name: 'i-03f6a562b9e9aec3e'
2021-04-16T19:50:03.4880215Z Runner group name: 'Default'
2021-04-16T19:50:03.4881048Z Machine name: 'ip-172-31-6-197'
2021-04-16T19:50:03.4883428Z ##[group]GITHUB_TOKEN Permissions
2021-04-16T19:50:03.4884366Z Actions: read
2021-04-16T19:50:03.4884791Z Checks: read
@webern
webern / git.sh
Last active October 25, 2020 23:47
#!/usr/bin/env bash
# create an annotated tag, the -a indicates that the tag will have a message
git tag –a v1.0.0 –m "This is the 1.0 release."
# same as above, but opens your text editor for the message
git tag –a v1.0.0
@webern
webern / heredoc.sh
Created August 14, 2020 00:18
I can never remember how to do heredocs
#!/usr/bin/env bash
# heredoc with shell expansion
cat << EOF
The current working directory is: $PWD
You are logged in as: $(whoami)
EOF
# heredoc with shell expansion into a variable
myvar=$(cat << EOF
@webern
webern / main.rs
Created July 20, 2020 02:20
Generalizing a Struct that holds a Cow
#![forbid(missing_debug_implementations, missing_copy_implementations)]
#![deny(rust_2018_idioms)]
#![deny(clippy::pedantic)]
#![allow(dead_code)]
use std::borrow::Cow;
use std::fmt::Debug;
/// A custom type. Clone is required by `Cow`. `Debug` is required by our example so that we can
/// easily print our results. `Copy` is added for completeness since `MyType` has no allocations.
@webern
webern / main.rs
Last active July 20, 2020 01:29
Rust struct where user decides who owns the data.
#![forbid(missing_debug_implementations, missing_copy_implementations)]
#![deny(rust_2018_idioms)]
#![deny(clippy::pedantic)]
#![allow(dead_code)]
use std::borrow::Cow;
struct YouDecide<'a> {
s: Cow<'a, str>
}
@webern
webern / file-permissions.txt
Last active November 17, 2020 01:00
File Permissions
https://www.drupal.org/node/2690335
Most files should be 644 or -rw-r--r--
All directories should be 755 or drwxr-xr-x
Files that are intended to be run at the command line should have the executable bit set meaning 755 or -rwxr-xr-x
Public Key: chmod 644
Private Key: chmod 600