Skip to content

Instantly share code, notes, and snippets.

View mort's full-sized avatar

Manuel González Noriega mort

View GitHub Profile
@mort
mort / gist:1196062
Created September 5, 2011 22:26
Final Crisis Reading Order
1. DC Universe #0
2. DC Universe: Last Will & Testament
3. Final Crisis #1
4. Final Crisis #2
5. Final Crisis: Requim
6. Final Crisis: Rogue's Revenge #1
7. Final Crisis: Rogue's Revenge #2
8. Final Crisis: Rogue's Revenge #3
9. Final Crisis #3
10. Final Crisis: Legion of Three Worlds #1
@mort
mort / gist:1192905
Created September 4, 2011 14:13
My GReader feed subscriptions (2011-09-04)
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Manuel González Noriega subscriptions in Google Reader</title>
</head>
<body>
<outline text="&amp;yet | the blog" title="&amp;yet | the blog"
type="rss" xmlUrl="http://andyet.net/blog/atom.xml" htmlUrl="http://andyet.net/blog/"/>
<outline text="7.5th Floor" title="7.5th Floor" type="rss"
xmlUrl="http://feeds.feedburner.com/FabienGirardin" htmlUrl="http://liftlab.com/think/fabien"/>
@mort
mort / gist:1156727
Created August 19, 2011 12:51
Beancounter API
class Activity < ActiveRecord::Base
def beancount
Rails.logger.info("Beancounting model")
# Counter for records of this class
# This will update a counter with a key of the form ["activity"]
beancount_model
Rails.logger.info("Beancounting attributes")
# Counter for appearances of specific values for attributes, including support for single (:foo) or multiple [:foo,:bar,:baz] attribute keys.
ree-1.8.7-2011.03 :147 > k = User.first.kbadges.find_or_create_by_title(:title => 'Foo', :variant=>"collectible", :badge_type=>"newbish", :description=>"Fashion gems are fashion!", :grant_activity_date=>"2009-10-28 08:02:29 UTC")
=> #<Kbadge id: nil, user_id: 1, title: {:variant=>"collectible", :badge_type=>"newbish", :description=>"Fashion gems are fashion!", :title=>"Foo", :grant_activity_date=>"2009-10-28 08:02:29 UTC"}, description: nil, variant: nil, badge_type: nil, badge_count: 0, grant_activity_date: nil, created_at: nil, updated_at: nil>
ree-1.8.7-2011.03 :148 > k.title
=> {:variant=>"collectible", :badge_type=>"newbish", :description=>"Fashion gems are fashion!", :title=>"Foo", :grant_activity_date=>"2009-10-28 08:02:29 UTC"}
@mort
mort / gist:1008318
Created June 4, 2011 20:25
Scissors
class Scissors
# power :cut, :objects => :cuttable
# These are the methods available for a thing with the power of cutting
def cut(thing, options = {}, restrictions = nil, &block)
return false unless may_cut?(thing, restrictions)
self.send(:before_cut) if self.respond_to?(:before_cut)
self.send(:do_cut, &block)
@mort
mort / gist:923018
Created April 16, 2011 09:41
GPS tracking
require 'rubygems'
require 'serialport'
require 'redis'
port_str = '/dev/tty.iBT-GPS-SPPslave'
baud_rate = 9600
data_bits = 8
stop_bits = 1
parity = SerialPort::NONE
@mort
mort / redis-ws-chat.js
Created December 8, 2010 00:43
Building on dealer.js (https://github.com/technoweenie/dealer.js) to experiment with Redis-based guest lists for websocket channels
var redisClient = require("redis-client"),
dealer = require("../lib"),
sys = require('sys'),
url = require('url')
var port = process.env['PORT'] || 3840
var redisConf = process.env['REDIS_URL'] || "redis://127.0.0.1:6379/0"
conn = dealer.create()
conn.server.listen(port)
@mort
mort / kandypot-node.js
Created November 4, 2010 13:48
Node.js + Redis pubsub + Websockets for kandypot.com.
// Really trivial. On new writes to the redis db, we push messages to a websocket channel
var sys = require("sys"), redis = require('./lib/redis-client'), ws = require("./lib/ws");
var pubsub = redis.createClient();
var clients = new Array();
ws.createServer(function (websocket) {
websocket.addListener("connect", function (resource) {
sys.debug("connect: " + resource);
client_id = resource.match(/apps\/([A-Za-z]+)\/timeline$/)[1];
require 'sinatra'
get '/' do
params[:url] ||= 'http://www.arroyodesanservan.org/WEB/Ayuntamiento/saludaAlcalde.php'
@url = params[:url]
erb :index
end
@mort
mort / gist:627118
Created October 14, 2010 21:45
A pattern language for reward systems in social web apps.

Below is a first draft of a typology of criteria used by social apps on their merits/badges/awards systems. It’s my intuition that’s there’s only a limited number of overarching principles sustaining such systems, and this list will try to catalog at least the most popular and easily found of those.

The methodology I’ll be using consists in revising available list of merits for different sites to try and detect the underlying patterns. For each pattern I provide a name, a description, notes if pertinent, relevant Foursquare examples, and a typical string literal associated to the badge.

Feedback, corrections, suggestions, and links to relevant literature will be greatly appreciated.

Manuel González Noriega - [email protected] - 2010

  1. Newbish