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
| class D | |
| def macro | |
| :referenced_in | |
| end | |
| def foreign_key | |
| "listimage_asset_id" | |
| end | |
| def eager_load ids |
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 | |
| # | |
| # Lives in .git/hooks. | |
| # To enable this hook, rename this file to "pre-commit". | |
| # Redirect output to stderr. | |
| exec 1>&2 | |
| # works, but is slow. try with ack! | |
| # LANG=C find . -name '*_spec.rb' | xargs egrep -q '^\s*(describe|it|context)\b.*focus' |
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/ruby | |
| require "fileutils" | |
| src = ARGV.first | |
| dest = ARGV.last | |
| Dir.chdir(src) do | |
| src_dirs = Dir["**/*/"].select{|node| !File.file? node } | |
| src_files = Dir["**/*"].select{|node| File.file? node } |
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
| sudo ifconfig en1 ether 60:33:4b:0b:50:0e | |
| ifconfig en1 | grep ether |
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
| telnet 127.0.0.1 1234 |
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
| #!/usr/bin/env ruby | |
| require "./rake_lib" | |
| require "./test_task" | |
| exec ARGV.first.to_sym |
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
| class Disposable | |
| class Twin | |
| def self.fake | |
| types = {} | |
| representer_class.representable_attrs[:definitions].each_pair do |key, value| | |
| types[key] = value.instance_variable_get(:@options)[:type] | |
| end | |
| attributes = {} | |
| puts types | |
| types.each_pair do |key, type| |
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
| ActiveSupport::Subscriber.subscribers.flat_map(&:patterns).grep(/trailblazer/).map &ActiveSupport::Notifications.method(:unsubscribe) |
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
| class ApplicationController < ActionController::Base | |
| include Trailblazer::Operation::Controller | |
| include Trailblazer::WithCurrentUser | |
| self.trb_with_current_user_param_key = :current_user | |
| self.trb_with_current_user_method = :current_user | |
| end |
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
| def find_route_name(path) | |
| Rails.application.routes.routes.select do |route| | |
| route.path.match path | |
| end.map(&:name).compact.first | |
| end |