This file contains 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
/** | |
* jQuery alterClass plugin | |
* | |
* Remove element classes with wildcard matching. Optionally add classes: | |
* $( '#foo' ).alterClass( 'foo-* bar-*', 'foobar' ) | |
* | |
* Copyright (c) 2011 Pete Boere (the-echoplex.net) | |
* Free under terms of the MIT license: http://www.opensource.org/licenses/mit-license.php | |
* | |
*/ |
This file contains 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
Hi, | |
The requirement is as follows | |
The app should be a standalone UI app, which can be built on top of Angular js (or any MVC js framework) or ember or any MVC js frameworks | |
The app should be connected to a twitter api, from which you can get updates from a particular handle (Eg: @rihanna) | |
When the handle posts a new update, the app should show a notification (without manual efforts) that there is a new tweet and should Display the new tweet within the application. | |
Feel free to use any css frameworks | |
It should be grid based | |
The app should have a ~good~ UI | |
It can be a single page app |
This file contains 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
<script type="text/javascript"> | |
var client = new Faye.Client('http://localhost:9292/faye'); | |
var message = client.publish('/foo', {text: message ,id: id, :number: number }); | |
</script> |
This file contains 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
<script type="text/javascript"> | |
var client = new Faye.Client('http://localhost:9292/faye'); | |
client.subscribe('/foo', function(message) { | |
$('#message').append('<p>'+message.number+ ' => ' +message.text+ '</p>'); // doing the UI stuff :) | |
$('#id').text(message.id); | |
}); | |
</script> |
This file contains 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 'eventmachine' | |
require 'faye' | |
EM.run { | |
client = Faye::Client.new('http://0.0.0.0:9292/faye') | |
client.subscribe('/anand9_calendar') do |message| | #a unique id is used as the channel name like calendar id | |
puts message.inspect | |
end |
This file contains 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 'eventmachine' | |
require 'faye' | |
message = "Hello world" | |
EM.run { | |
client = Faye::Client.new('http://0.0.0.0:9292/faye') | |
client.publish('/anand9_calendar', 'text' => message) | #a unique id is used as the channel name like calendar id | |
puts "pushed #{message}" |
This file contains 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
<%= check_box_tag "unsubscribe_email[]", checked_value = "1", unchecked_value = "0" %> |