Skip to content

Instantly share code, notes, and snippets.

View scottcreynolds's full-sized avatar

Scott C Reynolds scottcreynolds

View GitHub Profile
require_relative './jukebox'
RSpec.configure do |config|
config.color_enabled = true
config.tty = true
# Use the specified formatter
config.formatter = :documentation # :progress, :html, :textmate
end
def capture_stdout(&block)
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)
module TemplateTest
class Application < Rails::Application
class BST
attr_accessor :data, :left, :right
def initialize(data)
@data = data
end
def insert(data)
if data <= self.data
do_insert("left", data)
@scottcreynolds
scottcreynolds / .gitconfig
Last active August 29, 2015 14:21
Git aliases
[user]
name = me
email = [email protected]
[alias]
s = status -s
cm = commit -m
br = branch
branches = branch -a
del = branch -d
co = checkout
staging:
rails:
configuration:
asset_pipeline_precompile: false
@scottcreynolds
scottcreynolds / dj_objects.txt
Created October 11, 2017 20:58 — forked from EBashkoff/dj_objects.txt
Get Objects from Delayed Job
Get a deserialized object from a delayed job:
1. Get the delayed_job record using the id: dj = DelayedJob.find(<id>)
2. Get the handler field from dj: dj.handler
3. Convert it from YAML: YAML.parse(dj.handler)
4. You can get the ruby objects that the delayed job was built with by converting that to_ruby and calling the object:
YAML.parse(dj.handler).to_ruby.user
YAML.parse(dj.handler).to_ruby.prospect
YAML.parse(dj.handler).to_ruby.agent
etc.
@scottcreynolds
scottcreynolds / get-weave-ip-address-for-csv1-containers
Created March 15, 2018 15:41
A simple tool to show the IP address of each container on a server
for i in $(docker ps | awk '{print $1 ":" $2}')
do
container_id=$(echo $i | awk -F ':' '{print $1}')
container_service=$(echo $i | awk -F ':' '{print $2}')
container_ip_address=$(weave ps | grep $container_id | awk '{print $NF}')
echo "${container_service} : ${container_ip_address}"
done
@scottcreynolds
scottcreynolds / instructions.md
Last active July 11, 2018 18:22
Install Elastic for Mac OS X
@scottcreynolds
scottcreynolds / Hello.jsx
Created March 28, 2019 01:51
Hello React
ReactDOM.render(
<h1>Hello, world!</h1>,
document.getElementById('root')
);
<div id="root"></div>
@scottcreynolds
scottcreynolds / BagItemSelected.lua
Last active January 18, 2023 00:41
Ulduar Addon Patches
AuctionatorBagItemSelectedMixin = CreateFromMixins(AuctionatorBagItemMixin)
local seenBag, seenSlot
function AuctionatorBagItemSelectedMixin:OnClick(button)
if not self:ProcessCursor() then
AuctionatorBagItemMixin.OnClick(self, button)
end
end