Skip to content

Instantly share code, notes, and snippets.

View alexcharlie's full-sized avatar

Alexander Le alexcharlie

View GitHub Profile
require 'rubygems'
require 'rfacebook'
RAILS_ROOT = File.expand_path(File.dirname(__FILE__) + '/..') unless defined? RAILS_ROOT
RAILS_ENV = ENV['RAILS_ENV'] || 'development' unless defined? RAILS_ENV
require File.join(RAILS_ROOT, 'config', 'initializers', 'starling')
ConfigFace = YAML.load_file(File.join(RAILS_ROOT, 'config', 'facebook.yml'))[RAILS_ENV]
def query_parse(qs, d = '&;')
params = {}
(qs||'').split(/[#{d}] */n).inject(params) { |h,p|
k, v=unescape(p).split('=',2)
if cur = params[k]
if cur.class == Array
params[k] << v
else
params[k] = [cur, v]
end
@items = Item.find(:all, :conditions => {:visible => true, :equipment_slot => GameConfig.equipment_slots.index(params[:slot])}).
inject(Hash.new { |hash, new_key| hash[new_key] = [] }) { |category_groups, item| category_groups[item.category_id] << item; category_groups }.
values.
collect {|category_group| category_group.sort_by(&:cost)}.
flatten
#fast
band_a.members.length.times { |i| band_a.members[i].clear_buff(self.round); band_b.members[i].clear_buff(self.round) }
#slow
(band_a.members + band_b.members).each { |i| i.clear_buff(self.round) }
index = 0
max = 100
begin
puts index
index += 2
end while (index < max)
Hi, my name is ByunTae from South Korea. I have been playing Starcraft since 1998 and I was born and raised in Korea. I'm 100% full blooded Korean, meaning I have been gifted with unparallel talent to master any video game, particularly, Starcraft: Brood War. I'm also experienced in Counter-Strike, I am able to perform bunny hops, my best score on a public 32 player game was 171-2 with 170 kill streak. I'm offering my expertise in Starcraft to be taught to non-Koreans that wishes to have the skill of a Korean player. I have advised and coached many professional gamers such as Im Jae Dong, Park Myung Soo, Ma Jae Yoon, and more. Boxer and I were great friends until he started using my dropships to gain his fame. I started training other players to be on par with Boxer and eventually surpassing Boxer. He is no longer the best player thanks to my contribution to rest of the players. I did not compete in pro gaming because they KTF did not agree with my seven figure contract demand.
Things I will be teaching in
-I wish Google Maps had an "Avoid Ghetto" routing option.
-More often than not, when someone is telling me a story all I can
think about is that I can't wait for them to finish so that I can tell
my own story that's not only better, but also more directly involves
me.
-Nothing sucks more than that moment during an argument when you
realize you're wrong.
def do_damage(options={})
actual_damage = self.attacker.jitter_damage
actual_damage *= 2 if options[:crit]
# damage reduction
self.damage = (actual_damage * (1.00 - normalize(self.armor * 0.001)))).round
self.defender.health -= self.damage
end
mysql> select s.name, sum(sp.points), RPAD('', sum(sp.points) / 1000, '#') as bar from (skill_progresses as sp join users as u on sp.user_id = u.id) join skills s on sp.skill_id = s.id where u.level > 10 group by sp.skill_id;
+-------------------+----------------+------------------------------------------------------------------------------------------------------------+
| name | sum(sp.points) | bar |
+-------------------+----------------+------------------------------------------------------------------------------------------------------------+
| Sabotage | 2411 | ## |
| First Aid | 16928 | ################# |
| Vehicle Operation | 27540 | #################