Skip to content

Instantly share code, notes, and snippets.

$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)));
}
@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>#">
@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: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:23
facebook login button
<fb:login-button scope="publish_actions">Login with Facebook</fb:login-button>
@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);
}
require "rubygems"
require "xmpp4r"
require 'xmpp4r/client'
require 'xmpp4r/muc'
jabber_user = "user@jabber.ru"
jabber_password = "password"
jabber_conference = "conf@conference.jabber.ru"
jabber_nick = "user"
rs.initiate({"_id" : "default", members : [
{"_id" : 0, priority : 3, host : "host:27017"},
{"_id" : 1, host : "host:27018"},
{"_id" : 2, host : "host:27019", arbiterOnly : true}
]
});
$connections = array(
'hosts' => array(
array(
'host' => 'host',
),
array(
'host' => 'host',
'port' => 27018,
),
),
/*
RequireJS 2.0.4 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
Available via the MIT or new BSD license.
see: http://github.com/jrburke/requirejs for details
*/
var requirejs,require,define;
(function(Y){function x(b){return J.call(b)==="[object Function]"}function G(b){return J.call(b)==="[object Array]"}function q(b,c){if(b){var e;for(e=0;e<b.length;e+=1)if(b[e]&&c(b[e],e,b))break}}function N(b,c){if(b){var e;for(e=b.length-1;e>-1;e-=1)if(b[e]&&c(b[e],e,b))break}}function y(b,c){for(var e in b)if(b.hasOwnProperty(e)&&c(b[e],e))break}function K(b,c,e,i){c&&y(c,function(c,j){if(e||!b.hasOwnProperty(j))i&&typeof c!=="string"?(b[j]||(b[j]={}),K(b[j],c,e,i)):b[j]=c});return b}function s(b,
c){return function(){return c.apply(b,arguments)}}function Z(b){if(!b)return b;var c=Y;q(b.split("."),function(b){c=c[b]});return c}function $(b,c,e){return function(){var i=fa.call(arguments,0),g;if(e&&x(g=i[i.length-1]))g.__requireJsBuild=!0;i.push(c);return b.apply(null,i)}}function aa(b,c,e){q([["