robsite

In ruby

____ _ _____ __ _ ____ ___ ____ ______ __ _ ____

Mit dem _ Gem kann man Programme schreiben, die nur aus Unterstrichen bestehen. Das ganze ist valider Rubycode.

require "_"  
____ _ _____ ____ __ ____ ____ __ ___ ____ __ __ _ ______  
_____ ___ _ _ ___ _____ ______ ____ _ _ ____ _ _ ____ _  
____ __ __ ___ _ ______ ___ ____ __ ______ ____ _ ____ ____  
__ _ ____ _ _ ___ _____ _____ _ ______ ____ _ ______ _____

=> "Hello, world!"

WTF. Der Code des Gems ist ganze 23 Zeilen lang und ich hab mit meinen mageren Ruby-Kenntnissen eine Weile gebraucht, um zu verstehen, was da passiert. Hier eine kleine Analyse:

· ruby, tutorial, whoa, wtf ·

Rubular

Schicker Regex-Tester zum live ausprobieren von Rubys regulären Ausdrücken. Auch nicht übel ist RegExr, benötigt allerdings Flash und benutzt Action Scripts Regex-Engine.

· flash, regex, ruby ·

Compiled hello world with MacRuby

* full mode: no full ruby spec support, no runtime code generation, no LLVM. (”very light application and/or if the environment does not support runtime code generation” (hint-hint))

Also wirds in ferner Zukunft möglich sein, iPhone-Programme in Ruby zu schreiben. Wohé. Für simple Apps vielleicht sogar schnell genug...

· iphone, mac, ruby ·

tenderlove’s enterprise at master – GitHub

Wish you could write your Ruby in XML? Has the fact that Ruby is not "enterprise" got you down? Do you feel like your Ruby code could be made to be more "scalable"? Well look no further my friend. You’ve found the enterprise gem. Once you install this gem, you too can make Rails scale, Ruby faster, your code more attractive, and have more XML in your life.

· :D, ruby ·

Humanize Array

Kleine Funktion zum schönen ausgeben von Arrays.

# [1, 2, 3] => "1, 2 and 3"
# [1, 2]    => "1 and 2"
# [1]       => "1"
def humanize_array a
  [a[0..-3], [a[-2], a[-1]].compact.join(" and ")].flatten.join(", ")
end
· ©, ruby ·

Ultraviolet Syntaxes

Kleine Notiz für mich, da ich das immer vergesse und es auch nicht auf Ultraviolets Website steht:

actionscript, active4d, active4d_html, active4d_ini, active4d_library, ada, antlr, apache, applescript, asp, asp_vb.net, bibtex, blog_html, blog_markdown, blog_text, blog_textile, build, bulletin_board, c++, c, cake, camlp4, cm, coldfusion, context_free, cs, css, css_experimental, csv, d, diff, dokuwiki, dot, doxygen, dylan, eiffel, erlang, f-script, fortran, fxscript, greasemonkey, gri, groovy, gtd, gtdalt, haml, haskell, html-asp, html, html_django, html_for_asp.net, html_mason, html_rails, html_tcl, icalendar, inform, ini, installer_distribution_script, io, java, javaproperties, javascript, javascript+prototype, javascript+prototype_bracketed, jquery_javascript, json, languagedefinition, latex, latex_beamer, latex_log, latex_memoir, lexflex, lighttpd, lilypond, lisp, literate_haskell, logo, logtalk, lua, m, macports_portfile, mail, makefile, man, markdown, mediawiki, mel, mips, mod_perl, modula-3, moinmoin, mootools, movable_type, multimarkdown, objective-c++, objective-c, ocaml, ocamllex, ocamlyacc, opengl, pascal, perl, php, plain_text, pmwiki, postscript, processing, prolog, property_list, python, python_django, qmake_project, qt_c++, quake3_config, r, r_console, ragel, rd_r_documentation, regexp, regular_expressions_oniguruma, regular_expressions_python, release_notes, remind, restructuredtext, rez, ruby, ruby_experimental, ruby_on_rails, s5, scheme, scilab, setext, shell-unix-generic, slate, smarty, sql, sql_rails, ssh-config, standard_ml, strings_file, subversion_commit_message, sweave, swig, tcl, template_toolkit, tex, tex_math, textile, tsv, twiki, txt2tags, vectorscript, xhtml_1.0, xml, xml_strict, xsl, yaml, yui_javascript

Das sind die verfügbaren Syntaxen in Ultraviolet. Erzeugt hiermit:

require 'rubygems'
require 'uv' 
File.open('/Users/rob/Desktop/syntaxes.txt', 'w') {|f| f.write(Uv.syntaxes.join(', '))}

Ultraviolet ist eine klasse Library zum highlighten von Syntax. Benutz ich zusammen mit tm_syntax_highlighting für die schicken Codeboxen hier im Blag. tm_syntax_highlighting wiederum liest die Farbdefinitionen von TextMate aus, wodurch der Code hier genauso chique aussieht wie in meinem Lieblingseditor. Har!

· rails, ruby, webdev ·

Rails + Merb = Rails

Beginning today, the Merb team will be working with the Rails core team on a joint project. [...] Effectively, Merb 2 is Rails 3.

Whoa.

Why!?

As you have probably gathered from the above, there aren’t any clear points that the Merb and Rails team disagree on anymore. [...] Given this philosophical convergence, it just didn’t seem like there was much to gain by continuing to duplicate effort and spend time and energy fighting each other.

· merb, rails, ruby, webdev ·