Skip to content

Instantly share code, notes, and snippets.

View brianjking's full-sized avatar
💭
Doin' cool stuff at BrandMuscle AI

Brian J King brianjking

💭
Doin' cool stuff at BrandMuscle AI
View GitHub Profile
@brianjking
brianjking / security-checklist.md
Created April 18, 2025 15:08 — forked from mattppal/security-checklist.md
A simple security checklist for your vibe coded apps

Frontend Security

Security Measure Description
Use HTTPS everywhere Prevents basic eavesdropping and man-in-the-middle attacks
Input validation and sanitization Prevents XSS attacks by validating all user inputs
Don't store sensitive data in the browser No secrets in localStorage or client-side code
CSRF protection Implement anti-CSRF tokens for forms and state-changing requests
Never expose API keys in frontend API credentials should always remain server-side
@brianjking
brianjking / code_review.sh
Created October 18, 2024 12:31 — forked from alwin-augustin-dev/code_review.sh
Automated code review using local LLMs
#!/bin/bash
# Define variables
REPO_PATH=""
PR_NUMBER=""
OLLAMA_API_URL="http://localhost:11434/api/generate"
OUTPUT_FILE="code_review_output.md"
MODEL="llama3.1:8b"
MAX_CONTEXT_LINES=20000

Keybase proof

I hereby claim:

  • I am brianjking on github.
  • I am iamrobotbear (https://keybase.io/iamrobotbear) on keybase.
  • I have a public key ASDLDmgY4cq1hp2A-BCKVImHndr33bHH9KyG_J9Z4lUxRQo

To claim this, I am signing this object:

@brianjking
brianjking / tmux-cheatsheet.markdown
Created August 23, 2018 17:07 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
https://imgur.com/a/XRYNGsV
#!/bin/bash
MC_API_KEY="apikey:YOUR_KEY"
MC_LIST_ID="YOUR LIST ID"
# don't forget to update usN to your own MailChimp data center ID
TOTAL_ITEMS=`curl --silent --request GET --url "https://usN.api.mailchimp.com/3.0/lists/$MC_LIST_ID/members?fields=total_items" --user $MC_API_KEY | jq -r ".total_items"`
CHUNK_SIZE=1000
echo "id,email_address,status,avg_open_rate,avg_click_rate,timestamp_signup,last_changed,member_rating" > mailchimp_list.csv
echo "action,timestamp,url,type,campaign_id,title,parent_campaign,subscriber_id" > mailchimp_list_activity.csv
@brianjking
brianjking / subscribers-count.php
Created July 19, 2018 17:52 — forked from kovshenin/subscribers-count.php
Get subscribers count via the MailChimp API.
<?php
/**
* Get subscribers count via the MailChimp API.
*/
function mailchimp_get_subscribers_count() {
$cache_key = 'mailchimp-subscribers';
$api_key = '';
$username = '';
$dc = '';
$list_id = '';
@brianjking
brianjking / woocommerce-composites-variable-container-weight.php
Created May 3, 2018 02:06
Use this snippet to have the weight of composited products added to the container weight when the Non-Bundled Shipping option is unchecked.
<?php
/**
* Plugin Name: WooCommerce Composite Products - Variable Container Weight
* Plugin URI: http://woocommerce.com/products/composite-products/
* Description: Use this snippet to have the weight of composited products added to the container weight when the Non-Bundled Shipping option is unchecked.
* Version: 1.0
* Author: SomewhereWarm
* Author URI: http://somewherewarm.gr/
* Developer: Manos Psychogyiopoulos
*
@brianjking
brianjking / woocommerce-optimize-scripts.php
Created February 23, 2018 17:22 — forked from DevinWalker/woocommerce-optimize-scripts.php
Only load WooCommerce scripts on shop pages and checkout + cart
/**
* Optimize WooCommerce Scripts
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
*/
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
//remove generator meta tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@brianjking
brianjking / install.sh
Created February 14, 2018 17:39 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`