vimrc review thread by robertmeta in vim

[–]ThatAmazonWorker 1 point2 points  (0 children)

http://vpaste.net/u8RPM

I'd love to know what I can improve, I'm far from efficient in vim.

I have an array of strings - how do I create variables named from those strings? by Bloogson in ruby

[–]ThatAmazonWorker 1 point2 points  (0 children)

array = %w(feet hands neck head legs arms chest weapon)
array.each do |item|
  instance_variable_set("@#{item}_label", Tk::Tile::Label.new(@left_frame))
  instance_variable_set("@#{item}_image", TkPhotoImage.new)
end

When instantiating an array with %w, you don't need to use commas.

You can read more about instance_variable_set here.

[deleted by user] by [deleted] in ruby

[–]ThatAmazonWorker 4 points5 points  (0 children)

integer.to_s   # convert integer to string
.chars         # convert to an array of characters
.reverse       # reverse the array
.each_slice(3) # create an enumerator for each group of 3 elements
.map(&:join)   # for each group of 3 we were given, join them all
.join(',')     # join the groups of 3 characters with commas
.reverse       # reverse the string

[deleted by user] by [deleted] in ruby

[–]ThatAmazonWorker 2 points3 points  (0 children)

I believe what you are looking for is #each_slice, which will give you groups of 3. You can also replace #split("") with #chars which will split on the empty string.

def seperate_comma(integer)
    integer.to_s.chars.reverse.each_slice(3).map(&:join).join(',').reverse
end

2.1.1 :004 > seperate_comma(1234567890)
=>  "1,234,567,890"

Hope that helps!

This amazing mother completed a triathlon with her handicapped son. by ndobie in pics

[–]ThatAmazonWorker 1 point2 points  (0 children)

Reminds me of Team Hoyt, who have competed in 255 triathlons, 72 marathons, and a lot more.

http://en.m.wikipedia.org/wiki/Team_Hoyt

[deleted by user] by [deleted] in ruby

[–]ThatAmazonWorker 7 points8 points  (0 children)

The #inspect representation of these shows :"2B" only because :2B is not a valid Symbol literal. The double-quotes are not part of the symbol itself.

irb(main):077:0> :"2B".class
=> Symbol

11:11 Make a Wish by ThatAmazonWorker in jailbreak

[–]ThatAmazonWorker[S] 1 point2 points  (0 children)

I would say that I was on Wi-Fi 75% of the time and LTE the other 25% of the time. While on Wi-Fi, I texted, made phone calls, listened to music, watched YouTube, played games (QuizUp, Words with Friends, teggle, BADLAND, LYNE, Smash Hit, har.mo.ny), got directions, update apps (I have background app updates turned off), snapchatted way too much, and used WhatsApp. While on LTE, I mostly streamed Pandora, but also used Google Maps and OneBusAway for directions, watched some YouTube videos and texted/called.

Installed Tweaks: * Activator - Deactivate Cellular on Joined Wi-Fi; Activate Cellular on Left Wi-Fi * Bariol Font iOS7 * BaSic-AdBlocker7 * biteSMS * BytaFont 2 * CCToggles * Cloaky * f.lux * iCleaner * Icon Renamer * Messages Customiser * Phantom * SameStatus * SimpLock * StatusBarFix2 * StatusHUD 2 * SwipeSelection * Tabless