Skip to content

Instantly share code, notes, and snippets.

View mrflip's full-sized avatar

Philip (flip) Kromer mrflip

View GitHub Profile
module Wuclan::Models
#
# Text and metadata for a twitter status update
#
class Tweet < TypedStruct.new(
:id,
:created_at,
:twitter_user_id,
:favorited,
require 'wuclan/models/tweet/tweet_token'
require 'wukong/encoding'
module Wuclan::Models
Tweet.class_eval do
def string_for_tokenizing
# simpleminded test for non-latin script: don't bother if > 20 entities
return if (text.count('&') > 20)
# skip default message from early days
return if (text =~ /just setting up my twttr/);
# return decoded, whitespace-flattened text
require 'wuclan/models/tweet/tweet_token'
require 'wukong/encoding'
module Wuclan::Models
Tweet.class_eval do
def string_for_tokenizing
# simpleminded test for non-latin script: don't bother if > 20 entities
return if (text.count('&') > 20)
# skip default message from early days
return if (text =~ /just setting up my twttr/);
# return decoded, whitespace-flattened text
@mrflip
mrflip / morbid.el
Created July 30, 2009 22:07
morbid.el
;;; morbid.el --- Morbid phrase utility for invoking the Gmail Ads pity setting.
;;
;; To use this:
;; Just before sending mail, do M-x morbid.
;;
;; A number of phrases will be inserted into your buffer, to help Gmail's Ad
;; Robot decide that this is an email about arranging your aunt's funeral and
;; thus the wrong place to see a Netflix Ad. Ho ho ho! We've so outsmarted
;; them! More like discretion is the better part of *Chumphood*!
<div class="toggle" id="news">
<!-- following will only be included if there are posts -->
{% for t in site.posts %} {% assign has_posts = true %}{% endfor %}{% if has_posts %}
<h2>{{ site.gemname | capitalize }} News</h2>
<ul class="posts">
{% for post in site.posts %}
<li><span>{{ post.date | date_to_string }}</span> &raquo; <a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
apt-get install git-core libpcre3 libpcre3-dev libonig2 libonig-dev ruby1.8-dev irb ri rdoc libmysql-ruby libxml-ruby libsqlite3-ruby libmysqlclient15off libmysqlclient15-dev libsqlite3-0 libsqlite3-dev libxml2 libxml2-dev libopenssl-ruby1.8 libxslt-dev nginx libfcgi-dev libidn11 libidn11-dev mysql-client mysql-common mysql-server curl libcurl4-openssl-dev libexpat1-dev libreadline5-dev libssl-dev
# on fink
fink install oniguruma oniguruma-shlibs
sudo gem install --no-ri --no-rdoc rails rake ri rdoc mysql addressable chriseppstein-compass haml-edge mislav-will_paginate nokogiri oniguruma chronic tlsmail uuidtools eventmachine extlib htmlentities idn json hpricot RedCloth
sudo gem install --no-ri --no-rdoc aslakhellesoy-cucumber notahat-machinist flay flog rcov reek relevance-rcov roodi rspec rspec-rails brynary-webrat ZenTest railroad
sudo gem install --no-ri --no-rdoc mongrel thin mongrel_cluster passenger rack rack_csrf capistrano capistrano-ext capistrano_colors fiveruns-dash-activerecord fiveruns-dash-r
class ApplicationController < ActionController::Base
before_filter :authorize
# Base case: ask the controller's default model if this action is allowed
# Controllers should a prepend_before_filter to set the @resource
def authorize
unless controller_model.authorizes?(params[:action].to_sym, @resource)
respond_to_unauthorized(@resource)
end
end
---
:benchmark: false
:update_sources: true
:backtrace: false
:bulk_threshold: 1000
:verbose: true
gem: --no-rdoc --no-ri
:sources:
- http://gems.github.com
- http://gems.rubyforge.org/
commit 79ff7dc7a11ac02d7ab48a451614a1daf118e392
Author: Philip (flip) Kromer <flip@infochimps.org>
Date: Sat Oct 17 01:04:15 2009 -0500
the daemonized ssh causes a ruckus if ControlMaster connections are set by default. -o ControlPath=none fixes this
diff --git a/hadoop-ec2 b/hadoop-ec2
index 653dce9..865f355 100755
--- a/hadoop-ec2
giac ~/ics/koko$ irb
>> Regexp.compile(".", Regexp::EXTENDED)
=> x
giac ~/ics/koko$ ./script/console
Loading development environment (Rails 2.3.4)
>> Regexp.compile(".", Regexp::EXTENDED)
ArgumentError: wrong number of arguments (2 for 1)
from (irb):1:in `compile'