Skip to content

Instantly share code, notes, and snippets.

View kidbrax's full-sized avatar

Braxton Beyer kidbrax

View GitHub Profile
totomz /
Last active September 11, 2023 08:37
A simple script to push a JSON log to AWS CLoudWatch
LOG_STREAM="$(whoami)-$( date "+%Y%m%d-%H-%M-%S")"
aws logs create-log-stream --log-group-name $LOG_GROUP --log-stream-name $LOG_STREAM $AWS_REGION $AWS_PROFILE
Faheetah / Jenkinsfile.groovy
Last active June 17, 2024 15:05
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
ampedandwired / template.rb
Last active August 26, 2020 03:43
Splitting cfndsl templates into multiple files
require_relative "subtemplate.rb"
CloudFormation {
instance_type = external_parameters.fetch(:instance_type, "t2.micro")
prwhite / Makefile
Last active July 16, 2024 02:14
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
andrewh / anyconnect.scpt
Last active April 12, 2024 08:48
Applescript to automate the Cisco AnyConnect SSL VPN client on OS X Mavericks
-- 1. Place in ~/Library/Scripts and enable the Applescript menu via the Applescript Editor
-- 2. Substitute "" and "redacted" for your VPN server and password
-- 3. Open Security & Privacy System Preferences, go to Privacy, Accessibility
-- 4. Enable Applescript Editor and System UI Server
-- 5. Trigger script from the menu
-- 6. Enjoy being connected
tell application "Cisco AnyConnect Secure Mobility Client"
end tell
aheckmann / mongoose_with_mongo2-2_elemMatch_projection.js
Created September 5, 2012 17:31
using the $elemMatch projection with mongoose
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var assert = require('assert')
console.log(' mongoose version: %s', mongoose.version);
var dbname = 'testing_1085';
mongoose.connect('localhost', dbname);
kurko / spec_helper.rb
Created February 29, 2012 21:37
Sunspot with RSpec
#inside RSpec.configure
config.before :all do
config.before(:all, search: true) do
metaskills / wait_until.rb
Last active May 2, 2024 01:51
Never sleep() using Capybara!
# WAIT! Do consider that `wait` may not be needed. This article describes
# that reasoning. Please read it and make informed decisions.
# Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations?
describe 'Modal' do
should 'display login errors' do
visit root_path
chanmix51 / app.nginx.conf
Created August 17, 2011 08:45
nginx vhost conf silex & symfony
server {
listen 80;
root /var/www/app/web;
index index.php;
location ~ \.php$ {
fastcgi_index index.php;
include fastcgi_params;
bdwong / configure.patch
Created April 6, 2011 19:14
Patch to SWIG 2.0.2 to make it build with rvm under Mac OS 10.6
--- configure 2011-02-20 12:24:48.000000000 -0800
+++ configure.mine 2011-03-29 15:46:00.000000000 -0700
@@ -8654,15 +8654,20 @@
RUBYDIR=`($RUBY -rmkmf -e 'print Config::CONFIG["archdir"] || $archdir') 2>/dev/null`
if test x"$RUBYDIR" != x""; then
- dirs="$RUBYDIR"
+ # dirs for rvm
+ dirs="`cd $MY_RUBY_HOME/include/*/*/ruby/..;pwd` `cd $MY_RUBY_HOME/include/*;pwd`"