Skip to content

Instantly share code, notes, and snippets.

View steinbachr's full-sized avatar
😎
Wishing I Was In San Diego

Bobby Steinbach steinbachr

😎
Wishing I Was In San Diego
View GitHub Profile
@steinbachr
steinbachr / s3-to-sftp.py
Last active September 3, 2022 04:19
ETL script for moving data between an S3 bucket and an SFTP server
# to use, simply set the variables on lines 14-20 and run python main.py
from pathlib import Path
from tqdm import tqdm
import boto3
import os
import paramiko
import logging
logger = logging.getLogger(__name__)
@steinbachr
steinbachr / acf-dump-creator.php
Created August 21, 2022 18:04
Creates a JSON file which can be imported via standard ACF workflow
<?php
# Script taken from https://dev-notes.eu/2017/01/convert-acf-fields-registered-by-php-to-importable-json-format/. Instructions for usage can be found there.
$groups = acf_get_local_field_groups();
$json = [];
foreach ($groups as $group) {
// Fetch the fields for the given group key
$fields = acf_get_fields($group['key']);
@steinbachr
steinbachr / my-environment.md
Created May 25, 2021 19:43
Tools, packages, and applications I like on my local

Applications

Fig - Autocomplete for the shell

<div class="privacy-policy">
<h1>Privacy Policy</h1>
<section id="privacy-information-we-collect">
<h3>What information do we collect?</h3>
<p>We collect information from you when you register on our site, place an order, subscribe to our newsletter, respond to a survey or fill out a form.</p>
<p>When ordering or registering on our site, as appropriate, you may be asked to enter your: name, e-mail address, mailing address, phone number, credit card information or social security number. You may, however, visit our site anonymously.
Google, as a third party vendor, uses cookies to serve ads on your site. Google's use of the DART cookie enables it to serve ads to your users based on their visit to your sites and other sites on the Internet. Users may opt out of the use of the DART cookie by visiting the Google ad and content network privacy policy.</p>
</section>
@steinbachr
steinbachr / debug-job.yaml
Created February 24, 2020 01:10
Creates a K8 job which is ready to accept exec commands
apiVersion: batch/v1
kind: Job
metadata:
name: debug-job
labels:
app.kubernetes.io/name: debug-job
spec:
template:
metadata:
labels:
@steinbachr
steinbachr / ec2kill.sh
Created February 12, 2019 04:54
Bash function to find and terminate an EC2 instance having a given private DNS name
function ec2terminate() {
DNS_NAME=$1
echo "finding EC2 instance with DNS name $DNS_NAME"
EC2_INSTANCE_ID=$(aws ec2 describe-instances | jq --raw-output '.Reservations[].Instances[] | select(.PrivateDnsName == "'"$DNS_NAME"'") | .InstanceId')
echo "terminating EC2 instance with ID $EC2_INSTANCE_ID"
aws ec2 terminate-instances --instance-ids $EC2_INSTANCE_ID
@steinbachr
steinbachr / webpack_require_ensure.js
Last active September 17, 2016 04:52
Ternary Operator not acting as expected when evaluating webpack require ensure
// THIS WORKS (Code is properly split into two chunks)
if (IS_TABLET) {
require.ensure(['./Checkout.Tablet.react.js'], function (require) {
TabletOrPhone = require('./Checkout.Tablet.react.js');
});
} else {
require.ensure(['./Checkout.Mobile.react.js'], function (require) {
TabletOrPhone = require('./Checkout.Mobile.react.js');
});
}