Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am naveedehmad on github.
  • I am naveed (https://keybase.io/naveed) on keybase.
  • I have a public key whose fingerprint is 62FF 4E3B AFC7 DB0F A3E4 52AD 48E9 B7C7 2910 5135

To claim this, I am signing this object:

@naveedehmad
naveedehmad / LICENSE.txt
Created October 15, 2012 17:59 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@naveedehmad
naveedehmad / gist:3422758
Created August 22, 2012 06:05
Number of times each character used in a string
def count_chars(input_string)
char_count_map = {}
char_list = []
input_string.chars.each do |ch|
if not char_count_map.has_key?(ch)
char_list << ch
char_count_map[ch] = 0
end
char_count_map[ch] += 1