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: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)
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: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.
@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: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 / crawl.rb
Created October 19, 2011 15:57
A very basic but flexible approach to performing tasks on files and folders by invoking a callback object rather than acting directly on them
# Doing a crawl, passing a Doer class and a couple of regexp to filter out the filenames
require 'crawler'
crawler = Crawler.new('/Users/mort/Documents', Doer, :patterns => [/foo/, /karma/])
crawler.crawl
require 'faye'
Faye::Logging.log_level = :debug
Faye.logger = lambda { |m| puts m }
class LinkResolver
def self.fetch(m)
@mort
mort / gist:7040118
Created October 18, 2013 11:18
Molecules
module Siblings
module Stuff
class Molecule
include Observable
include Traits::Moves
alias_method :place_in, :move_to
attr_reader :uuid, :element, :placement
SSL is the encryption protocol used to secure communications over the web (HTTP) When that little lock icon appears in your browser's location bar, the HTTP traffic between the browser and the server is being encrypted with so-called public key cryptography, making it unreadable to people sniffing your traffic. Banking transactions, communications and any other sensible information should, and these days almost in every case is, transmitted with HTTP over SSL (HTTPS)
OpenSSL is the most popular library out there for allowing servers and client to encrypt HTTP with SSL. The Heartbleed bug is a programming flaw in this library (In the library, not in the protocol itself) that allows an attacker to read the system memory of computers using it. That means reading the memory where credentials, financial information and any other kind of sensitive and non-sensitive info is stored. So, attackers could, and with all certainty have, gotten their hands on a lot of stuff they should never have had access to.
So, this
@mort
mort / gist:5038eb6afdb583937f0c
Created July 30, 2014 22:13
Reading list: Historia de la tecnología
- Pre 1960
* http://www.amazon.com/The-Victorian-Internet-Remarkable-Nineteenth/dp/0802716040/ref=pd_bxgy_b_text_y
* http://www.amazon.com/Turings-Cathedral-Origins-Digital-Universe/dp/1400075998/ref=sr_1_1
http://www.amazon.com/The-Chip-Americans-Microchip-Revolution/dp/0375758283/ref=pd_rhf_dp_s_cp_1
- General history
* http://www.amazon.com/Hackers-Computer-Revolution-Anniversary-Edition/dp/1449388396/ref=pd_vtp_b_3