Skip to content

Instantly share code, notes, and snippets.

Nicolas Mérouze nmerouze

View GitHub Profile
View gist:3040
/usr/bin/c++ -bundle -headerpad_max_install_names -o qtruby4.so "CMakeFiles/qtruby4.dir/Qt.o" "CMakeFiles/qtruby4.dir/handlers.o" "CMakeFiles/qtruby4.dir/marshall_types.o" -L/Users/nicolas/Downloads/qt4-qtruby-1.4.10/smoke/qt -F/Library/Frameworks -framework QtCore -lpthread -lruby -F/Library/Frameworks -framework QtNetwork -lsmokeqt -F/Library/Frameworks -framework QtCore -lpthread -F/Library/Frameworks -framework QtGui -F/Library/Frameworks -framework QtNetwork -F/Library/Frameworks -framework QtOpenGL -F/Library/Frameworks -framework QtDBus -F/Library/Frameworks -framework QtSql -F/Library/Frameworks -framework QtSvg -lQtUiTools -F/Library/Frameworks -framework QtXml -F/Library/Frameworks -framework QtWebKit
View gist:3041
/usr/bin/c++ -bundle -headerpad_max_install_names -o qtruby4.so "CMakeFiles/qtruby4.dir/Qt.o" "CMakeFiles/qtruby4.dir/handlers.o" "CMakeFiles/qtruby4.dir/marshall_types.o" -L/Users/nicolas/Downloads/qt4-qtruby-1.4.10/smoke/qt -F/Library/Frameworks -framework QtCore -lpthread -lruby -F/Library/Frameworks -framework QtNetwork -lsmokeqt -F/Library/Frameworks -framework QtCore -lpthread -F/Library/Frameworks -framework QtGui -F/Library/Frameworks -framework QtNetwork -F/Library/Frameworks -framework QtOpenGL -F/Library/Frameworks -framework QtDBus -F/Library/Frameworks -framework QtSql -F/Library/Frameworks -framework QtSvg -lQtUiTools -F/Library/Frameworks -framework QtXml -F/Library/Frameworks -framework QtWebKit
View gist:4423
document.observe("dom:loaded", function() {
$$('#nav li:first-child').invoke('addClassName', 'first');
});
View gist:4427
def flash_messages
fl = ''
[:help, :notice, :error].each do |name|
next unless flash[name]
fl << content_tag(:div, flash[name], :class => "flash #{name}")
flash[name] = nil
end
fl unless fl.empty?
end
View gist:5043
document.observe("dom:loaded", function() {
if ($$('.flash').length > 0) $$('.flash').invoke('fade', { delay: 3.0 });
});
View gist:5968
module ActionView
module Helpers
class FormBuilder
module FormBuilderExtension
def hint(method, text)
errors = object.errors.on(method)
hint_message = "<span class='hint'>#{text}</span>"
if errors.blank?
hint_message
View gist:5969
# Hack for make_resourceful plugin.
module Resourceful
class Builder
module BuilderExtension
def set_flash(action, message)
after(action) { flash[:notice] = message }
end
end
include BuilderExtension
View gist:7070
class Cmd
attr_reader :output, :pid, :status
def initialize(cmd_line)
IO.popen(cmd_line) do |f|
@output = f.readlines
@pid, @status = Process.wait2
end
end
View gist:9177
// jquery.red.js
var domReady = function(handler) { jQuery(document).ready(handler); };
var j = jQuery;
View gist:9250
# simple.red
Ruby.puts "Hello World!"
You can’t perform that action at this time.