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(ehaml). | |
-compile(export_all). | |
% -export([indentation_level/1, split_lines/1, strip_indentation/1, is_tag/1]). | |
-define(CR, 13). | |
-define(LF, 10). | |
-define(SPACE, 32). | |
-define(PERCENT, $%). | |
-define(APOS, $'). |
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
%%%------------------------------------------------------------------- | |
%%% File: twitter.erl | |
%%% @author Sean Cribbs <seancribbs@gmail.com> [] | |
%%% @copyright 2008 Sean Cribbs | |
%%% @doc Bindings for the Twitter API | |
%%% Include 'twitter.hrl' in your module to get the records. | |
%%% @end | |
%%% | |
%%% @since 2008-10-30 by Sean Cribbs | |
%%% @type auth() = {User::string(), Password::string()} |
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
19> twitter:search("#rubyconf"). ** exception error: function_clause | |
in function twitter:parse_twitter_time/1 | |
in call from twitter:parse_search_result/1 | |
in call from mochiweb_util:urlencode/1 | |
in call from twitter:parse_search_results/1 | |
in call from mochiweb_util:urlencode/1 |
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
%%%------------------------------------------------------------------- | |
%%% File: gen_phone.erl | |
%%% @author Sean Cribbs <> [] | |
%%% @copyright 2009 Sean Cribbs | |
%%% @doc | |
%%% | |
%%% @end | |
%%% | |
%%% @since 2009-01-08 by Sean Cribbs | |
%%%------------------------------------------------------------------- |
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
def compare_user | |
%w{uid gid comment home shell password}.any? do |att| | |
!@new_resource.send(att).nil? && @new_resource.send(att) != @current_resource.send(att) | |
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
DEBUG: /usr/local/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/mixin/command.rb:240:in `egid=': Operation not permitted (Errno::EPERM) | |
from /usr/local/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/mixin/command.rb:240:in `popen4' | |
from /usr/local/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/mixin/command.rb:219:in `fork' | |
from /usr/local/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/mixin/command.rb:219:in `popen4' | |
from /usr/local/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/mixin/command.rb:164:in `run_command' | |
from /usr/local/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/mixin/command.rb:153:in `chdir' | |
from /usr/local/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/mixin/command.rb:153:in `run_command' | |
from /usr/local/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/provider/execute.rb:48:in `action_run' | |
from /usr/local/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/runner.rb:87:in `send' | |
... 7 levels... |
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
% Damn record_info compilation | |
-define(create_table(RecordName),(fun() -> | |
try | |
mnesia:table_info(type, RecordName) | |
catch | |
exit:_ -> | |
mnesia:create_table(RecordName, [{attributes, record_info(fields, RecordName)}, | |
{type, ordered_set}, | |
{disc_copies, [node()]}]) | |
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
h(Text) -> | |
html_escape(Text). | |
html_escape("") -> ""; | |
html_escape(Text) -> | |
WithoutAmp = re:replace(Text, "&", "\\&", [global, {return, list}]), | |
WithoutLt = re:replace(WithoutAmp, "<", "\\<", [global, {return, list}]), | |
WithoutGt = re:replace(WithoutLt, ">", "\\>", [global, {return, list}]), | |
re:replace(WithoutGt, "\"", "\\"", [global, {return, list}]). |
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 'rubygems' | |
require '/path/to/radiant/api/lib/radiant/api' # http://github.com/radiant/radiant-api | |
require 'activerecord' | |
ActiveRecord::Base.establish_connection( | |
"adapter" => "mysql", | |
"host" => "localhost", | |
"database" => "mephisto", | |
"username" => "***********", | |
"password" => "***********") |
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us"> | |
<title type="text">Sean Cribbs</title> | |
<link rel="self" href="http://seancribbs.com<r:url />" /> | |
<link rel="alternate" type="text/html" href="http://seancribbs.com/" /> | |
<id>http://seancribbs.com/</id> | |
OlderNewer