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
# The following snippet handles any calls to ap or awesome_print hanging out in your code, | |
# which can be particularly troublesome in a production environment where awesome_print isn't | |
# included in your Gemfile. | |
# If you have any inline "ap" or "awesome_print" calls, they will be aliased to | |
# puts (not using the alias method, that wasn't optimal). The output will also be logged at | |
# info level (feel free to change this depending on your needs) with the calling file and | |
# line number so you can find the offending calls. | |
# You can grep through your log files for "[ AP called from " to find any calls to ap. |
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
# terminal colors | |
export CLICOLOR=1 | |
# vars | |
# ... omitted ... | |
# aliases | |
alias l='ls -lashF' # ' --color=always' | |
alias be='bundle exec' |
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
Find HTML Entities | |
&[^\s]*; |
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 | |
require 'benchmark' | |
require 'active_support/core_ext/array' # required for Array.wrap. | |
# by the way, did you know there is a "my_array.fourty_two()" method? | |
Benchmark.bm do |b| | |
language = [] | |
100.times do | |
language << "8foanin" |
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
#!/bin/bash | |
sudo killall -HUP mDNSResponder |
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
class HomeController < ApplicationController | |
layout 'login' | |
before_filter :actions_if_signed_in | |
def index | |
end | |
def blocked | |
end |
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
# Audited initializer to globally disable audits except when needed. | |
# https://gist.github.com/4392334 | |
# | |
# Hacked from idea originally provided in issue: | |
# https://github.com/collectiveidea/audited/issues/18 | |
# by Frost (github.com/Frost) | |
# | |
# Modified by Doug Clark (github.com/dougc84) | |
# | |
# Add this in an initializer (audited.rb) |
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
# :enddoc: | |
require 'test/unit/testcase' | |
if defined?(ActionController) | |
require 'shoulda/matchers/action_controller' | |
class ActionController::TestCase | |
include Shoulda::Matchers::ActionController | |
extend Shoulda::Matchers::ActionController |
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
install_package "openssl-1.0.1e" "https://www.openssl.org/source/openssl-1.0.1e.tar.gz#66bf6f10f060d561929de96f9dfe5b8c" mac_openssl --if has_broken_mac_openssl | |
install_package "ruby-2.0.0-p247" "http://www.mirrorservice.org/sites/ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz" standard verify_openssl |
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
# try requiring and including awesome_print | |
# if gem is not installed, will simply pass over this. | |
require "awesome_print" | |
AwesomePrint.pry! if defined?(AwesomePrint) | |
# | |
# output becomes: | |
# | |
# [1] app_folder_name development(main)> def something | |
# 1 > "hello" |
OlderNewer