is this thing on?
Fri
Apr
24
getting synergy to work on ubuntu login screen
Add these to the end of the specified files. I only needed the first one the last time I set this up, but I had done all three in the past.
/etc/kde4/kdm/Xsetup
/usr/bin/killall synergyc
sleep 1
/usr/bin/synergyc <servier-ip-address>
/etc/kde4/kdm/Xstartup
/usr/bin/killall synergyc
sleep 1
/etc/kde4/kdm/Xsession
/usr/bin/killall synergyc
sleep 1
/usr/bin/synergyc <servier-ip-address>
Fri
Dec
26
merb's provides/display in rails
DHH posted about merging merb’s provides/display into rails. He proposed used a dual of respond_to and respond_with, similar to merb’s provides/display, with a couple tweaks to allow each action to respond to different types. There are a couple things about the API he suggested which I don’t love:
- I don’t like the way respond_with(@deals, :to => [:html, :json, :xml]) reads, why not flip that around and do respond_to(:html, :json, xml, :with => Deal.new). This would work very well with how the current responds_to method works in rails, just adding an :with option to allow converting that object instead of rendering a partial. (see the index action below)
- When using the class-level respond_to, we could use respond_to(:with => Deal.new), or keep an alias of repond_with(Deal.new) (see the new action below)
- It would be nice to have an easy way to use the defaults for some response types, but allow customization for others. (see the create action below)
class DealsController < SubjectsController
respond_to :html, :xml, :json
def index
@deals = Deal.all
respond_to(:html, :xml, :json, :atom, :with => @deals)
end
def new
respond_to(:with => Deal.new)
# uses the class-level defined response types (html, xml, and json)
# maybe this is a good case for also having respond_with(Deal.new)
end
def create
@deal = Deal.create!(params[:deal])
respond_to(:xml, :json, :with => @deal) do |format|
format.html { redirect_to @deal }
end
end
end
Wed
Dec
3
multi-line strings in javascript
var myString = ' first line \ second line \ third line \ ';
Wed
Oct
15
installing libxml-ruby on leopard
- sudo port install libxml2
- sudo env ARCHFLAGS=”-arch i386” gem install libxml-ruby — —with-xml2-include=/opt/local/include/libxml2 —with-xml2-lib=/opt/local/lib
Fri
Jul
25
If you ever replace drag/drop elements on the page (eg. through rjs) make sure you unregister the old ones first, or IE will crash.