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
| /* <![CDATA[ */ | |
| //============================================================ | |
| // ZALGO text script by tchouky | |
| //============================================================ | |
| // data set of leet unicode chars | |
| //--------------------------------------------------- | |
| //those go UP | |
| var zalgo_up = [ |
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 'exifr' | |
| files = Dir['*.jpg'] | |
| puts "Renaming #{files.count} files..." | |
| new_file_names = Hash.new { |h,k| h[k] = [] } | |
| files.each do |file| | |
| exif = EXIFR::JPEG.new(file) | |
| dt = exif.date_time_original | |
| new_file_name = "#{dt.strftime('%Y-%m-%d %H.%M.%S')}" |
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 'set' | |
| class Subway | |
| attr_reader :stops | |
| def initialize(lines) | |
| @stops = {} | |
| lines.each_pair {|line, stops| | |
| stops.each do |stop| |
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
| # https://rubymonk.com/learning/books/1-ruby-primer/problems/150-kaprekar-s-number | |
| def kaprekar?(k) | |
| k_st = k.to_s | |
| kk = k**2 | |
| kk_st = kk.to_s | |
| offset_length = kk.to_s.length.odd? ? k_st.length - 1 : k_st.length | |
| left = kk_st[0, offset_length] | |
| right = kk_st[offset_length, k_st.length] | |
| k == left.to_i + right.to_i | |
| 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
| # Now more objecty | |
| class PotOfCoffee | |
| attr_reader :scoops | |
| def initialize(quantity: 12, strength: :normal) | |
| @quantity = quantity | |
| @strength = strength | |
| 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
| var ReverseSearch = { | |
| onReady: function(){ | |
| $("#rsearch input").on("keyup change", ReverseSearch.wait); | |
| }, | |
| wait: function(e){ | |
| clearTimeout($.data(this, 'timer')); | |
| if (e.keyCode == 13){ | |
| ReverseSearch.rsearch(true); | |
| } else { | |
| $(this).data('timer', setTimeout(ReverseSearch.rsearch, 500)); |
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
| module MTA | |
| LINES = { | |
| n: ['ts', '34th', '28th-n', '23rd-n', 'us'], | |
| l: ['8th', '6th', 'us', '3rd', '1st'], | |
| s: ['gc', '33rd', '28th-s', '23rd-s', 'us'] | |
| } | |
| Stop = Struct.new(:line, :point) | |
| class Route |
NewerOlder