Skip to content

Instantly share code, notes, and snippets.

View enderahmetyurt's full-sized avatar
🦄

Ender Ahmet Yurt enderahmetyurt

🦄
View GitHub Profile
@enderahmetyurt
enderahmetyurt / non_repeat.rb
Created June 30, 2025 10:20
Find the last non-repeating character in a given string.
def non_repeat(str)
counts = Hash.new(0)
str.each_char { |char| counts[char] += 1 }
str.reverse.each_char do |char|
return char if counts[char] == 1
end
""
end
@enderahmetyurt
enderahmetyurt / binding_pry.sublime-snippet
Created April 2, 2019 13:27
Auto complete for binding.pry
<snippet>
<content><![CDATA[
binding.pry
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>bp</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.ruby, source.ruby.rails, source.text.haml</scope>
<description>auto complete for binding.pry</description>
</snippet>