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
# Comment on a blog post | |
{ "index" : { "_index" : "activities", "_type" : "comment", "_id" : "HBASE-ACTIVITY-ID" } } | |
{ "aggregation_id" : "HBASE-AGGREGATION-ID", | |
"activity_types" : ["comment", "type2", "etc..."], | |
"timestamp" : "2009-11-15T14:12:12", | |
"content" : { | |
"key" : "value" #(e.g json data describing the activity - an application can use this to display the activity) | |
}, | |
"user" : { | |
"user_id" : "red rover user id" |
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 'digest' unless defined?(Digest) | |
# Just in case this isn't a rails app | |
class Hash | |
def to_query | |
require 'cgi' unless defined?(CGI) && defined?(CGI::escape) | |
map {|k,v| [k,v].map {|p| CGI::escape(p.to_s) }.join('=') }.join('&') | |
end | |
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
select DATE_FORMAT(u.created_at, '%Y-%m'), DATE_FORMAT(p.published_at, '%Y-%m'), count(*) FROM pfeed_items p, users u where u.id = p.originator_id and p.type IN ('Pfeeds::UserJoinedGroup', 'Pfeeds::UserLeftGroup', 'Pfeeds::UserInvitedUser', 'Pfeeds::UserSharedActivity', 'Pfeeds::UserMessagedGroup', 'Pfeeds::UserPostedItem', 'Pfeeds::UserAttachedTag', 'Pfeeds::UserCreatedBlogPost', 'Pfeeds::UserLikedItem', 'Pfeeds::UserFollowedItem') AND u.created_at > '2012-01-01' AND p.published_at > '2012-01-01' GROUP BY DATE_FORMAT(u.created_at, '%Y-%m'), DATE_FORMAT(p.published_at, '%Y-%m') |
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
# TODO: Add the code |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Bootstrap, from Twitter</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.0.4/css/bootstrap-combined.min.css" rel="stylesheet"> | |
</head> | |
<body> |
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
# Change files around and other magic... | |
ls -d *.hbs | sed -e 's/.*/mv & &/' |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle' | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
tagsSorting: ['id'], | |
tags: [ | |
{id: 1, color: 'cp-colour-1'}, | |
{id: 11, color: 'cp-colour-1'}, | |
{id: 6, color: 'cp-colour-6'}, | |
{id: 3, color: 'cp-colour-3'}, | |
{id: 4, color: 'cp-colour-4'} |
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
Just some text |