Skip to content

Instantly share code, notes, and snippets.

@pfeilbr
pfeilbr / aws-template.gliffy
Created August 31, 2022 12:49
aws-template.gliffy
{
"contentType": "application/gliffy+json",
"version": "1.3",
"stage": {
"background": "#FFFFFF",
"width": 3411,
"height": 1329,
"nodeIndex": 236,
"autoFit": true,
"exportBorder": false,
@pfeilbr
pfeilbr / dropbox-delete-conflicted.sh
Last active June 2, 2022 02:24
dropbox delete folders containing the string conflicted
# delete all folders containing the string "conflict"
while true
do
dbxcli ls -l /mac01/Users/brianpfeil/projects/ > paths.txt
while read p; do
if echo $p | grep -iqF conflict; then
full_path=$(echo "/${p#*/}")
echo $full_path
dbxcli rm --force "$full_path"
fi
@pfeilbr
pfeilbr / index.js
Last active May 14, 2022 23:15
fetch all aws directory api metadata (arch diagrams, products, blog posts, builders library articles, etc.)
// fetch all aws directory api metadata
(async () => {
const directories = [
{
"directoryId": "event-content"
},
{
"directoryId": "amazon-redwood"
},
{
assumed_role_arn="$(aws sts get-caller-identity --query 'Arn' | sed -e 's/"//g' | sed -e 's/\/[[:alnum:]]*$//')"
@pfeilbr
pfeilbr / markdown-notes-manipulation.sh
Created June 7, 2021 14:23
markdown notes manipulation
cd notes
for f in *.md; do
first_line=$(head -n 1 $f)
if [[ ! $first_line = \#* ]] ; then
#echo "${f}"
barename=$(basename $f .md)
# echo "${barename}"
# prepend bare filename as H1 to top of note
echo -e "# ${barename}\n\n$(cat $f)" > $f
@pfeilbr
pfeilbr / a.c
Last active September 21, 2020 15:25
// gh cli test edit
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
float rand_float(float max_value)
{
return (float)rand() / ((float)RAND_MAX / max_value);
}
@pfeilbr
pfeilbr / index.jsx
Created September 12, 2020 12:17
react tsx/jsk cdk app
// pseudocode
const { ReactCDK, App, Stack } = require('@aws-cdk/react')
const Bucket = require('@aws-cdk/react/s3')
const { CloudFrontDistribution, Origins, DefaultOrigin } = require('@aws-cdk/react/cloudfront')
const { Api, Resource, Integration } = require('@aws-cdk/react/apigateway')
const Lambda = require('@aws-cdk/react/lambda')
const EchoLambda = (
<Lambda>
{
// ==UserScript==
// @name AWS Blog Article Focus
// @namespace http://aws.amazon.com/
// @version 0.1
// @description remove extra content from AWS blog articles
// @author Brian Pfeil
// @match https://aws.amazon.com/blogs/*
// @grant none
// @updateURL https://gist.githubusercontent.com/pfeilbr/7d828b65bd49a048e7aa3d587a91001e/raw/aws-blog-article-focus.js
// @downloadURL https://gist.githubusercontent.com/pfeilbr/7d828b65bd49a048e7aa3d587a91001e/raw/aws-blog-article-focus.js
@pfeilbr
pfeilbr / ExtendableProxy.js
Created October 6, 2019 16:52
example of extendable javascript proxy
(() => {
class RectProxy {
props = {
position: (newPos, twojs) => {
twojs.doWork();
},
innerColor: (newColor, twojs) => {