pry -r ./config/app_init_file.rb
-- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
-- load your rails into a pry session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# CLI tool for locating and removing a Homebrew installation | |
# http://brew.sh/ | |
# | |
# Copyright (C) 2014 Stephen C. Benner | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# This bit of code lets you define Environment variables in your shell via a YAML file. | |
# It works by composing Bash commands from the parsed data, meant to be executed within | |
# a Bash environment, which will export the variables just as in a regular Bash profile. | |
# This is accomplished by executing this script via the Bash substitution syntax $(...) | |
# which returns the output of evaluating whatever is inside the parenthesis, which in | |
# the case of this script would be appropriate 'export' commands that are run by Bash. | |
# | |
# This version is designed to parse aliases organized under named groups in the YAML |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ Generate an HTML5 video tag with embedded Flash fallback | |
/ @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video HTML5 video tag spec | |
/ | |
/ @local [Hash] video Attribute hash for the `video` tag | |
/ @option video [Integer] :width (320) Width of the video tag in pixels | |
/ @option video [Integer] :height (240) Height of the video tag in pixels | |
/ | |
/ @local [Hash] src Mapping of source file types to URLs for source files | |
/ @option src [String] :mp4 URL of an MP4 source file for the video | |
/ @option src [String] :webm URL of a WebM source file for the video |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# If you've got a collection of Bash aliases that just keeps growing... Consider using YAML! | |
# | |
# This version is designed to parse aliases organized under named groups in the YAML | |
# file, so the first level of mappings are purely semantic, and are used to keep the | |
# data organized and well-documented. | |
# | |
require 'pathname' | |
require 'yaml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Homebrew fix 1 - osxfuse dylibs | |
# | |
# original solutions: https://gist.github.com/aaronzirbes/3239033 | |
# https://gist.github.com/trinitronx/5437061 | |
# | |
# Fixes the following: | |
# | |
# > Warning: Unbrewed dylibs were found in /usr/local/lib. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Mac fix 4 - Disable CrashReporter | |
# | |
# CrashReporter is a daemon that monitors for crashes and generates a report (duh) when they occur. | |
# If an application (such as Finder) become stuck in an infinite crash loop, then sometimes it's | |
# desirable to just turn off CrashReporter entirely, as it will continually generate processes in | |
# the background which spew errors and logs, resulting in massive overhead to your system resources. | |
# | |
# DIAGNOSING: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jq = document.createElement('script'); | |
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
jQuery.noConflict(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Mac fix 1 - Install the Nokogiri gem on Mac OS 10.9 Mavericks | |
# | |
# Usage: to configure and install using Bundler, pass in 'bundle' as an argument to the script. | |
# | |
# Nokogiri works at a very low level, so it has many issues on various platforms. | |
# As a result, the command `install gem nokogiri` often will fail. This fix is for | |
# errors involving 'libiconv', such as the following one I encountered: | |
# |
NewerOlder