This file contains hidden or 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
namespace :grape do | |
desc "Condensed API Routes" | |
task :routes => :environment do | |
mapped_prefix = '' # where mounted in routes.rb | |
format = "%46s %3s %7s %50s %12s: %s" | |
API.routes.each do |grape_route| | |
info = grape_route.instance_variable_get :@options | |
puts format % [ | |
info[:description] ? info[:description][0..45] : '', | |
info[:version], |
This file contains hidden or 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
[diff] | |
# tool = bc3 | |
keepBackup = false | |
prompt = false | |
# [difftool "bc3"] | |
# dirDiff = true | |
# trustExitCode = true | |
# prompt = false | |
# keepTemporaries = false | |
# trustExitCode = true |
This file contains hidden or 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
require 'benchmark' | |
class QuestionScheduler | |
@queue = :email_notifications | |
MAX_ATTEMPTS = 2 | |
# ============================================================ | |
# When both queries are constrained to :current_enrollments | |
# the results are close with pluck ~2x speed improvement |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
************************************************************ | |
Result: Invalid | |
46 files validated. | |
906 errors found in 32 files. | |
Somewhere, a kitten is crying. | |
************************************************************ | |
valid public/stylesheets/ajaxful_rating.css | |
valid public/stylesheets/android.css |
This file contains hidden or 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/sh | |
export RUBYLIB="$TM_BUNDLE_SUPPORT/RubyMate${RUBYLIB:+:$RUBYLIB}" | |
/usr/bin/env ruby -KU -- "$SETH_BUNDLE_SUPPORT/RubyMate/run_script_with_zeus.rb" --name= |
This file contains hidden or 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
require "#{ENV["TM_SUPPORT_PATH"]}/lib/tm/executor" | |
require "#{ENV["TM_SUPPORT_PATH"]}/lib/tm/save_current_document" | |
require "pathname" | |
TextMate.save_if_untitled | |
# For Run focused unit test, find the name of the test the user wishes to run. | |
args = [ ] | |
if ARGV.first == "--name=" | |
n = ENV['TM_LINE_NUMBER'].to_i |
This file contains hidden or 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
#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -KU | |
ENV['RUBYLIB'] = "#{ENV['TM_BUNDLE_SUPPORT']}/RubyMate" | |
require "#{ENV['TM_BUNDLE_SUPPORT']}/RubyMate/run_script_with_zeus.rb" |
This file contains hidden or 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
Loaded Suite test,test/browser,test/fixtures,test/functional,test/integration,test/support,test/unit | |
Started at 2013-09-25 16:39:42 -0700 w/ seed 1886. | |
MyPasswordTest | |
PASS (0:00:00.003) alpha sequences | |
PASS (0:00:00.004) blacklist | |
PASS (0:00:00.019) blocks morons policy | |
PASS (0:00:00.020) min length | |
PASS (0:00:00.021) numeric sequences |
This file contains hidden or 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
require './test/test_helper.rb' | |
require "password_policy" | |
class MyPasswordTest < ActiveSupport::TestCase | |
def test_min_length | |
password = "howdy" | |
policy = PasswordPolicy.new({:min_length => 6}) | |
assert_equal(false, policy.validate(password)) |