Skip to content

Instantly share code, notes, and snippets.

View quard8's full-sized avatar

Irek Khasianov quard8

View GitHub Profile
$connections = array(
'hosts' => array(
array(
'host' => 'host',
),
array(
'host' => 'host',
'port' => 27018,
),
),
rs.initiate({"_id" : "default", members : [
{"_id" : 0, priority : 3, host : "host:27017"},
{"_id" : 1, host : "host:27018"},
{"_id" : 2, host : "host:27019", arbiterOnly : true}
]
});
require "rubygems"
require "xmpp4r"
require 'xmpp4r/client'
require 'xmpp4r/muc'
jabber_user = "[email protected]"
jabber_password = "password"
jabber_conference = "[email protected]"
jabber_nick = "user"
@quard8
quard8 / idnex.html
Created September 25, 2011 17:26
facebook post action
function post()
{
FB.api('/me/<ВАШ NAMESPACE>:listen' +
'?song=<ССЫЛКА НА СТРАНИЦУ>','post',
function(response) {
if (!response || response.error) {
alert('Error occured');
} else {
alert('Post was successful! Action ID: ' + response.id);
}
@quard8
quard8 / index.html
Created September 25, 2011 17:23
facebook login button
<fb:login-button scope="publish_actions">Login with Facebook</fb:login-button>
@quard8
quard8 / index.html
Created September 25, 2011 17:20
facebook meta tags
<meta property="fb:app_id" content="<ID приложения>" />
<meta property="og:type" content="<ВАШ NAMESPACE>:song" />
<meta property="og:title" content="The Magician - Magic Tape Fifteen" />
<meta property="og:image" content="http://i1.sndcdn.com/artworks-000011517440-ht8lrf-large.jpg?1e7f8e7" />
<meta property="og:description" content="Listen The Magician - Magic Tape Fifteen" />
<meta property="og:url" content="<ссылка на страницу>">
@quard8
quard8 / index.html
Created September 25, 2011 17:15
facebook js
<script src="http://connect.facebook.net/en_US/all.js"></script>
<div id="fb-root"></div>
<script>
FB.init({
appId:'<ID приложения>', cookie:true,
status:true, xfbml:true, oauth:true
});
</script>
@quard8
quard8 / index.html
Created September 25, 2011 17:01
Main hadr
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"
xmlns:fb="https://www.facebook.com/2008/fbml">
<head prefix="og: http://ogp.me/ns# <ВАШ NAMESPACE>:http://ogp.me/ns/apps/<ВАШ NAMESPACE>#">
$wantsSet = new Rediska_Key_Set("user:".$uid.":m");
$intersect = $wantsSet->intersect(new Rediska_Key_Set("user:".$uid.":w"));
$yeahCount = count($intersect);
if($intersect !== false && $yeahCount > 0)
{
$rediska->publish("notify", json_encode(array("uid" => $uid, 'count' => $yeahCount)));
}