Skip to content

Instantly share code, notes, and snippets.

@vijaydev
Created June 21, 2011 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vijaydev/1038004 to your computer and use it in GitHub Desktop.
Save vijaydev/1038004 to your computer and use it in GitHub Desktop.
> 5000.times do |i|
| a[i] = i
| end
> a.symbolize_keys.reject { |k,v| k.class == Fixnum }.sort { |x,y| x[1] <=> y[1] }
=> [[:"!", 33], [:, 37], [:, 38], [:, 42], [:, 43], [:-, 45], [:, 47], [:, 60], [:, 62], [:, 94], [:, 96], [:, 124], [:, 126], [:, 317], [:-, 318], [:, 319], [:=>, 320], [:, 321], [:, 322], [:"!=", 323], [:, 324], [:, 325], [:, 328], [:"!~", 329], [:"..", 330], [:"...", 331], [:[], 332], [:[], 333], [:, 334], [:, 335], [:"::", 336], [:__autoload__, 2881], [:__autoload__, 2884], [:__classpath__, 2889], [:__classpath__, 2892], [:__tmp_classpath__, 2897], [:__tmp_classpath__, 2900], [:"Object=", 2908], [:Object, 2909], [:__classid__, 2913], [:__classid__, 2916], [:"Module=", 2924], [:Module, 2925], [:"Class=", 2932], [:Class, 2933], [:__attached__, 2937], [:__attached__, 2940], [:"Kernel=", 2948], [:Kernel, 2949], [:allocate, 2953], [:allocate, 2956], [:initialize, 2961], [:initialize, 2964], [:inherited, 2969], [:inherited, 2972], [:initialize_copy, 2977], [:initialize_copy, 2980], [:included, 2985], [:included, 2988], [:extended, 2993], [:extended, 2996], [:method_added, 3001], [:method_added, 3004], [:method_removed, 3009], [:method_removed, 3012], [:method_undefined, 3017], [:method_undefined, 3020], [:nil?, 3031], [:equal?, 3039], [:eql?, 3047], [:id, 3049], [:id, 3052], [:type, 3057], [:type, 3060], [:class, 3065], [:class, 3068], [:clone, 3073], [:clone, 3076], [:dup, 3081], [:dup, 3084], [:taint, 3089], [:taint, 3092], [:tainted?, 3103], [:untaint, 3105], [:untaint, 3108], [:freeze, 3113], [:freeze, 3116], [:frozen?, 3127], [:to_a, 3129], [:to_a, 3132], [:to_s, 3137], [:to_s, 3140], [:inspect, 3145], [:inspect, 3148], [:methods, 3153], [:methods, 3156], [:singleton_methods, 3161], [:singleton_methods, 3164], [:protected_methods, 3169], [:protected_methods, 3172], [:private_methods, 3177], [:private_methods, 3180], [:public_methods, 3185], [:public_methods, 3188], [:instance_variables, 3193], [:instance_variables, 3196], [:instance_variable_get, 3201], [:instance_variable_get, 3204], [:instance_variable_set, 3209], [:instance_variable_set, 3212], [:instance_variable_defined?, 3223], [:remove_instance_variable, 3225], [:remove_instance_variable, 3228], [:instance_of?, 3239], [:kind_of?, 3247], [:is_a?, 3255], [:tap, 3257], [:tap, 3260], [:singleton_method_added, 3265], [:singleton_method_added, 3268], [:singleton_method_removed, 3273], [:singleton_method_removed, 3276], [:singleton_method_undefined, 3281], [:singleton_method_undefined, 3284], [:sprintf, 3289], [:sprintf, 3292], [:format, 3297], [:format, 3300], [:"Integer=", 3308], [:Integer, 3309], [:"Float=", 3316], [:Float, 3317], [:"String=", 3324], [:String, 3325], [:"Array=", 3332], [:Array, 3333], [:"NilClass=", 3340], [:NilClass, 3341], [:to_i, 3345], [:to_i, 3348], [:to_f, 3353], [:to_f, 3356], [:new, 3361], [:new, 3364], [:"NIL=", 3372], [:NIL, 3373], [:"Symbol=", 3380], [:Symbol, 3381], [:all_symbols, 3385], [:all_symbols, 3388], [:to_int, 3393], [:to_int, 3396], [:id2name, 3401], [:id2name, 3404], [:to_sym, 3409], [:to_sym, 3412], [:to_proc, 3417], [:to_proc, 3420], [:included_modules, 3425], [:included_modules, 3428], [:include?, 3439], [:name, 3441], [:name, 3444], [:ancestors, 3449], [:ancestors, 3452], [:attr, 3457], [:attr, 3460], [:attr_reader, 3465], [:attr_reader, 3468], [:attr_writer, 3473], [:attr_writer, 3476], [:attr_accessor, 3481], [:attr_accessor, 3484], [:instance_methods, 3489], [:instance_methods, 3492], [:public_instance_methods, 3497], [:public_instance_methods, 3500], [:protected_instance_methods, 3505], [:protected_instance_methods, 3508], [:private_instance_methods, 3513], [:private_instance_methods, 3516], [:class_variable_defined?, 3527], [:constants, 3529], [:constants, 3532], [:const_get, 3537], [:const_get, 3540], [:const_set, 3545], [:const_set, 3548], [:const_defined?, 3559], [:remove_const, 3561], [:remove_const, 3564], [:const_missing, 3569], [:const_missing, 3572], [:class_variables, 3577], [:class_variables, 3580], [:remove_class_variable, 3585], [:remove_class_variable, 3588], [:class_variable_get, 3593], [:class_variable_get, 3596], [:class_variable_set, 3601], [:class_variable_set, 3604], [:superclass, 3609], [:superclass, 3612], [:extend_object, 3617], [:extend_object, 3620], [:append_features, 3625], [:append_features, 3628], [:"Data=", 3636], [:Data, 3637], [:"TrueClass=", 3644], [:TrueClass, 3645], [:"TRUE=", 3652], [:TRUE, 3653], [:"FalseClass=", 3660], [:FalseClass, 3661], [:"FALSE=", 3668], [:FALSE, 3669], [:"Comparable=", 3676], [:Comparable, 3677], [:between?, 3687], [:"Enumerable=", 3692], [:Enumerable, 3693], [:entries, 3697], [:entries, 3700], [:sort, 3705], [:sort, 3708], [:sort_by, 3713], [:sort_by, 3716], [:grep, 3721], [:grep, 3724], [:count, 3729], [:count, 3732], [:find, 3737], [:find, 3740], [:detect, 3745], [:detect, 3748], [:find_index, 3753], [:find_index, 3756], [:find_all, 3761], [:find_all, 3764], [:select, 3769], [:select, 3772], [:reject, 3777], [:reject, 3780], [:collect, 3785], [:collect, 3788], [:map, 3793], [:map, 3796], [:inject, 3801], [:inject, 3804], [:reduce, 3809], [:reduce, 3812], [:partition, 3817], [:partition, 3820], [:group_by, 3825], [:group_by, 3828], [:first, 3833], [:first, 3836], [:all?, 3847], [:any?, 3855], [:one?, 3863], [:none?, 3871], [:min, 3873], [:min, 3876], [:max, 3881], [:max, 3884], [:minmax, 3889], [:minmax, 3892], [:min_by, 3897], [:min_by, 3900], [:max_by, 3905], [:max_by, 3908], [:minmax_by, 3913], [:minmax_by, 3916], [:member?, 3927], [:each_with_index, 3929], [:each_with_index, 3932], [:enum_with_index, 3937], [:enum_with_index, 3940], [:reverse_each, 3945], [:reverse_each, 3948], [:zip, 3953], [:zip, 3956], [:take, 3961], [:take, 3964], [:take_while, 3969], [:take_while, 3972], [:drop, 3977], [:drop, 3980], [:drop_while, 3985], [:drop_while, 3988], [:cycle, 3993], [:cycle, 3996], [:each, 4001], [:each, 4004], [:size, 4009], [:size, 4012], [:"Precision=", 4020], [:Precision, 4021], [:prec, 4025], [:prec, 4028], [:prec_i, 4033], [:prec_i, 4036], [:prec_f, 4041], [:prec_f, 4044], [:induced_from, 4049], [:induced_from, 4052], [:method_missing, 4057], [:method_missing, 4060], [:__id__, 4065], [:__id__, 4068], [:__send__, 4073], [:__send__, 4076], [:, 4083], [:, 4091], [:eval, 4097], [:eval, 4100], [:iterator?, 4111], [:block_given?, 4119], [:loop, 4121], [:loop, 4124], [:respond_to?, 4135], [:raise, 4137], [:raise, 4140], [:fail, 4145], [:fail, 4148], [:caller, 4153], [:caller, 4156], [:caller_for_all_threads, 4161], [:caller_for_all_threads, 4164], [:exit, 4169], [:exit, 4172], [:abort, 4177], [:abort, 4180], [:at_exit, 4185], [:at_exit, 4188], [:catch, 4193], [:catch, 4196], [:throw, 4201], [:throw, 4204], [:global_variables, 4209], [:global_variables, 4212], [:local_variables, 4217], [:local_variables, 4220], [:__method__, 4225], [:__method__, 4228], [:send, 4233], [:send, 4236], [:instance_eval, 4241], [:instance_eval, 4244], [:instance_exec, 4249], [:instance_exec, 4252], [:include, 4257], [:include, 4260], [:public, 4265], [:public, 4268], [:protected, 4273], [:protected, 4276], [:private, 4281], [:private, 4284], [:module_function, 4289], [:module_function, 4292], [:method_defined?, 4303], [:public_method_defined?, 4311], [:private_method_defined?, 4319], [:protected_method_defined?, 4327], [:public_class_method, 4329], [:public_class_method, 4332], [:private_class_method, 4337], [:private_class_method, 4340], [:module_eval, 4345], [:module_eval, 4348], [:module_exec, 4353], [:module_exec, 4356], [:class_eval, 4361], [:class_eval, 4364], [:class_exec, 4369], [:class_exec, 4372], [:remove_method, 4377], [:remove_method, 4380], [:undef_method, 4385], [:undef_method, 4388], [:alias_method, 4393], [:alias_method, 4396], [:define_method, 4401], [:define_method, 4404], [:nesting, 4409], [:nesting, 4412], [:extend, 4417], [:extend, 4420], [:trace_var, 4425], [:trace_var, 4428], [:untrace_var, 4433], [:untrace_var, 4436], [:set_trace_func, 4441], [:set_trace_func, 4444], [:SAFE, 4451], [:hash, 4457], [:hash, 4460], [:casecmp, 4465], [:casecmp, 4468], [:insert, 4473], [:insert, 4476], [:length, 4481], [:length, 4484], [:bytesize, 4489], [:bytesize, 4492], [:empty?, 4503], [:match, 4505], [:match, 4508], [:succ, 4513], [:succ, 4516], [:succ!, 4527], [:next, 4529], [:next, 4532], [:next!, 4543], [:upto, 4545], [:upto, 4548], [:index, 4553], [:index, 4556], [:rindex, 4561], [:rindex, 4564], [:replace, 4569], [:replace, 4572], [:to_str, 4577], [:to_str, 4580], [:dump, 4585], [:dump, 4588], [:upcase, 4593], [:upcase, 4596], [:downcase, 4601], [:downcase, 4604], [:capitalize, 4609], [:capitalize, 4612], [:swapcase, 4617], [:swapcase, 4620], [:upcase!, 4631], [:downcase!, 4639], [:capitalize!, 4647], [:swapcase!, 4655], [:hex, 4657], [:hex, 4660], [:oct, 4665], [:oct, 4668], [:split, 4673], [:split, 4676], [:reverse, 4681], [:reverse, 4684], [:reverse!, 4695], [:concat, 4697], [:concat, 4700], [:crypt, 4705], [:crypt, 4708], [:intern, 4713], [:intern, 4716], [:start_with?, 4727], [:end_with?, 4735], [:scan, 4737], [:scan, 4740], [:ljust, 4745], [:ljust, 4748], [:rjust, 4753], [:rjust, 4756], [:center, 4761], [:center, 4764], [:sub, 4769], [:sub, 4772], [:gsub, 4777], [:gsub, 4780], [:chop, 4785], [:chop, 4788], [:chomp, 4793], [:chomp, 4796], [:strip, 4801], [:strip, 4804], [:lstrip, 4809], [:lstrip, 4812], [:rstrip, 4817], [:rstrip, 4820], [:sub!, 4831], [:gsub!, 4839], [:chop!, 4847], [:chomp!, 4855], [:strip!, 4863], [:lstrip!, 4871], [:rstrip!, 4879], [:tr, 4881], [:tr, 4884], [:tr_s, 4889], [:tr_s, 4892], [:delete, 4897], [:delete, 4900], [:squeeze, 4905], [:squeeze, 4908], [:tr!, 4919], [:tr_s!, 4927], [:delete!, 4935], [:squeeze!, 4943], [:each_line, 4945], [:each_line, 4948], [:each_byte, 4953], [:each_byte, 4956], [:each_char, 4961], [:each_char, 4964], [:lines, 4969], [:lines, 4972], [:bytes, 4977], [:bytes, 4980], [:chars, 4985], [:chars, 4988], [:sum, 4993], [:sum, 4996]]
@vijaydev
Copy link
Author

Wow. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment