Skip to content

Instantly share code, notes, and snippets.

View radar's full-sized avatar

Ryan Bigg radar

View GitHub Profile
## Test [ruby]
<% form_tag({ :action => "update" }, :id => id, :enctype => "multipart/form-data") do %>
<div class="form">
<b><%= _("Resource MetaData")%></b><br />
<%= link_to _("Remove iTunes Metadata"), { :action => "remove_itunes_metadata", :id => resource.id}, :confirm => _("Are you sure?")%><br />
<label for="resource_itunes_author_<%= id %>"><%= _("Author")%>:</label><br />
<input name="resource[itunes_author]" size="25" id="resource_itunes_author_<%= id %>" type="text" value="<%=h resource.itunes_author %>" /><br />
<label for="resource_itunes_subtitle_<%= id %>"><%= _("Subtitle")%>:</label><br />
<input name="resource[itunes_subtitle]" size="25" id="resource_itunes_subtitle_<%= id %>" type="text" value="<%=h resource.itunes_subtitle %>" /><br />
<label for="resource_itunes_duration_<%= id %>"><%= _("Duration")%>:</label><br />
<% form_tag({ :action => "update" }, :id => id, :enctype => "multipart/form-data") do %>
<div class="form">
<b><%= _("Resource MetaData")%></b><br />
<%= link_to _("Remove iTunes Metadata"), { :action => "remove_itunes_metadata", :id => resource.id}, :confirm => _("Are you sure?")%><br />
<label for="resource_itunes_author_<%= id %>"><%= _("Author")%>:</label><br />
<input name="resource[itunes_author]" size="25" id="resource_itunes_author_<%= id %>" type="text" value="<%=h resource.itunes_author %>" /><br />
<label for="resource_itunes_subtitle_<%= id %>"><%= _("Subtitle")%>:</label><br />
<input name="resource[itunes_subtitle]" size="25" id="resource_itunes_subtitle_<%= id %>" type="text" value="<%=h resource.itunes_subtitle %>" /><br />
<label for="resource_itunes_duration_<%= id %>"><%= _("Duration")%>:</label><br />
<input name="resource[itunes_duration]" size="8" id="resource_itunes_duration_<%= id %>" type="text" value="<%=h resource.itunes_duration %>" /><small>(HH
no
Testing on safari.
require 'rubygems'
require 'hpricot'
require 'open-uri'
def get_count
/(\d+)/.match(open("top-secret-url") { |f| Hpricot(f) }.to_s.split("\n").first)[1]
end
old_count = get_count
loop do
require 'rubygems'
require 'hpricot'
require 'open-uri'
def get_count
lines = open("top-secret-url") { |f| Hpricot(f) }.to_s.split("\n")
/(\d+)/.match(lines.first)[1]
@person = /\["(.*?)",\s"(.*?)"/.match(lines[2])
@name = @person[2]
@username = @person[1]
radar@one-point-nine:~$ sudo gem install passenger
Building native extensions. This could take a while...
ERROR: Error installing passenger:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb install passenger
creating Makefile
make
gcc -I. -I/usr/local/include/ruby-1.9.1/i686-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -D_FILE_OFFSET_BITS=64 -fPIC -O2 -g -Wall -Wno-parentheses -o fastthread.o -c fastthread.c
radar@one-point-nine:~$ sudo gem install passenger
Building native extensions. This could take a while...
ERROR: Error installing passenger:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb install passenger
creating Makefile
make
gcc -I. -I/usr/local/include/ruby-1.9.1/i686-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -D_FILE_OFFSET_BITS=64 -fPIC -O2 -g -Wall -Wno-parentheses -o fastthread.o -c fastthread.c
radar@one-point-nine:~/rboard$ mongrel_rails start
/usr/local/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5/lib/mongrel/handlers.rb:214: warning: else without rescue is useless
/usr/local/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5/lib/mongrel.rb:22:in `require': /usr/local/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5/lib/mongrel/handlers.rb:208: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n' (SyntaxError)
...te(modified_since) rescue nil : false
... ^
/usr/local/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5/lib/mongrel/handlers.rb:209: syntax error, unexpected ':', expecting keyword_end
... : false
... ^
/usr/local/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5/lib/mongrel/handlers.rb:210: syntax error, unexpected ':', expecting keyword_end
... : false
radar@one-point-nine:~/rboard$ mongrel_rails start
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
/home/radar/rboard/vendor/rails/actionpack/lib/action_controller/routing/segments.rb:6: warning: encoding option is ignored - N
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart).
** Rails signals registered. HUP => reload (without restart). It might not work well.
** Mongrel 1.1.5 available at 0.0.0.0:3000
** Use CTRL-C to stop.