This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You can put this file in your lib directory. | |
# Don't forget to add 'use Rack::Facebook' in config.ru. | |
module Rack | |
class Facebook | |
def initialize(app) | |
@app = app | |
end | |
def call(env) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#counter{ data: { total: 143 } } 0 | |
$ -> | |
if $('#counter').length > 0 | |
animateCounter | |
animateCounter = -> | |
current = parseInt($('#counter').text()) | |
if current < $('#counter').data('total') | |
$('#counter').text(current + 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@participants = Participant.where("facebook_uid IN (?)", connected_friends).order('id DESC') | |
def connected_friends | |
graph = Koala::Facebook::API.new(get_user_oauth_token) | |
friends = graph.get_connections("me", "friends", fields: 'installed') | |
friends.collect do |f| | |
f["installed"] == true ? f["id"] : nil | |
end.compact | |
rescue => e | |
notify_honeybadger_or_ignore e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = 2 | |
b = 3 | |
print(a+b) |