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
module Wuclan::Models | |
# | |
# Text and metadata for a twitter status update | |
# | |
class Tweet < TypedStruct.new( | |
:id, | |
:created_at, | |
:twitter_user_id, | |
:favorited, |
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 '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 |
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 '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 |
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
;;; 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*! |
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
<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> » <a href="{{ post.url }}">{{ post.title }}</a></li> | |
{% endfor %} | |
</ul> |
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
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 |
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
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 |
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
--- | |
: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/ |
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
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 |
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
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' |