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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Web; | |
| using System.Web.Mvc; | |
| using Facebook; | |
| using MyFacebookSite3434.Models; | |
| using System.Web.Security; | |
| namespace MyFacebookSite3434.Controllers |
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
| require 'rubygems' | |
| require 'mongo' | |
| module MongoPubSub | |
| QUEUES_COLLECTION = 'queues' | |
| class EndSubscriptionException < Exception; end | |
| class Publisher | |
| def initialize(queue_name, mongo_connection) | |
| # Initialize queue collection as a capped collection | |
| if not mongo_connection[QUEUES_COLLECTION].collection_names.include?(queue_name) |
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
| # port of http://www.perlmonks.org/?node_id=162190 | |
| # | |
| # Please refactor this if necessary | |
| # leonb -at- beriedata -dot- nl | |
| # | |
| class String | |
| def yoda | |
| word = %w{is be will show do try are teach have look help see can learn has}.select { |word| self =~ /\b#{word}\b/ }[0] | |
| if word | |
| x = (self =~ /\b#{word}\b/) + word.size |
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
| if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () { | |
| var Storage = function (type) { | |
| function createCookie(name, value, days) { | |
| var date, expires; | |
| if (days) { | |
| date = new Date(); | |
| date.setTime(date.getTime()+(days*24*60*60*1000)); | |
| expires = "; expires="+date.toGMTString(); |
NewerOlder