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
| # Add mixin to /config/initializers/ | |
| module LogQuerySource | |
| def debug(*args, &block) | |
| return unless super | |
| backtrace = Rails.backtrace_cleaner.clean caller | |
| relevant_caller_line = backtrace.detect do |caller_line| | |
| !caller_line.include?('/initializers/') | |
| 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
| $(function(){ | |
| console.log("ready"); | |
| // while(count > -1) { | |
| var count = 10; | |
| var year = 1996; | |
| // console.log(count); | |
| // count--; | |
| // } | |
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
| # Define a Quadrilateral | |
| class Quadrilateral | |
| # Initalize | |
| def initialize(length, breadth) | |
| @length = length | |
| @breadth = breadth | |
| end | |
| # Create perimeter method | |
| def perimeter |
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
| (1..100).each {|num| | |
| if (num % 3 == 0 && num % 5 == 0) | |
| puts "FizzBuzz" | |
| elsif (num % 3 == 0) | |
| puts "Fizz" | |
| elsif (num % 5 == 0) | |
| puts "Buzz" | |
| else | |
| puts num | |
| end |