recipes

    • 1
      8 Dec 2011

      Now on Posterous Spaces: Embeddable Tweets

      • Edit
      • Delete
      • Tags
      • Autopost

      Now on Posterous Spaces: Embeddable Tweets post.ly/4BqnN

      — posterous (@posterous) December8, 2011
      via twitter.com

      • views
      • Tweet
      • Tweet
    • 3
      9 Sep 2011

      Friday morning

      • Edit
      • Delete
      • Tags
      • Autopost

      P645

      • views
      • Tweet
      • Tweet
    • 1
      3 Sep 2011

      Brenda remodel

      • Edit
      • Delete
      • Tags
      • Autopost

      P135

      • views
      • Tweet
      • Tweet
    • 1
      24 Jul 2011

      Mediating Mediums - The Digital 3d on Vimeo

      • Edit
      • Delete
      • Tags
      • Autopost
      via vimeo.com

      • views
      • Tweet
      • Tweet
    • 0
      31 Mar 2011

      Dezeen » Inside Out by Takeshi Hosaka Architects

      • Edit
      • Delete
      • Tags
      • Autopost
      Media_httpstaticdezee_ygnbj
      via dezeen.com

      • views
      • Tweet
      • Tweet
    • 0
      23 Mar 2011

      jsonp in rails 3

      • Edit
      • Delete
      • Tags
      • Autopost

      if you wanna make a cross-domain get request, jsonp would be a nice solution.

      on client side, if you use jquery then you would write something like this:

      $.ajax({
        url: 'http://other.domain.com/api/songs.json',
        type: 'GET',
        dataType: 'jsonp',
        success: function(data) {
          ...
        }
      });

      and on server side, by using rails 3, you can write this:

      render :json => @songs.to_json, :callback => params[:callback]
      • views
      • Tweet
      • Tweet
    • 0
      21 Mar 2011

      google coding style guides

      • Edit
      • Delete
      • Tags
      • Autopost

      javascript

      http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml

      json

      http://google-styleguide.googlecode.com/svn/trunk/jsoncstyleguide.xml

      python

      http://google-styleguide.googlecode.com/svn/trunk/pyguide.html

      • views
      • Tweet
      • Tweet
    • 0
      17 Mar 2011

      compatible SQL query in rails

      • Edit
      • Delete
      • Tags
      • Autopost

      if you try to write this kind of SQL in rails:

      'query' LIKE CONCAT('%', LOWER(field_name), '%')

      since this will only work in MySQL, if you wanna apply on SQLite, there are two ways you can try:

      1. add this method to your code (originally from here):

        # Symbols should be used for field names, everything else will be quoted as a string
         def db_concat(*args)
           adapter = configurations[RAILS_ENV]['adapter'].to_sym
           args.map!{ |arg| arg.class==Symbol ? arg.to_s : arg }
        
           case adapter
             when :mysql
               "CONCAT(#{args.join(',')})"
             when :sqlserver
               args.join('+')
             else
               args.join('||')
           end
         end
        
         
         # in your find() method
         :conditions => [ "? LIKE #{db_concat("\'%\'", 'LOWER(field_name)', "\'%\'")}", query.downcase ]
      2. use gem like this one: https://github.com/adamcrown/port-a-query (only works for MySQL and SQLite)

      there might be more gems solving this issue, but anyway, since i am not doing things so complicated, i choose the first approach.

      • views
      • Tweet
      • Tweet
    • 0
      17 Mar 2011

      enable 'paginate' method in your test

      • Edit
      • Delete
      • Tags
      • Autopost
      require 'will_paginate'
      WillPaginate.enable_activerecord
      WillPaginate.enable_named_scope
      via github.com

      • views
      • Tweet
      • Tweet
    • 0
      17 Mar 2011

      rubygems credential

      • Edit
      • Delete
      • Tags
      • Autopost

      location: ~/.gem/credentials

      but if you have multiple accounts like me, this is the gem you might be looking for:

      https://github.com/joshfrench/keycutter

      • views
      • Tweet
      • Tweet
    « Previous 1 2 3 Next »
    • Search

    • Archive

      • 2011 (12)
        • December (1)
        • September (3)
        • July (1)
        • March (7)
      • 2009 (1)
        • August (1)
    • Obox Design
  • recipes


    2075 Views
  • Get Updates

    Follow this Space »
    You're following this Space (Edit)
    You're a contributor here (Edit)
    This is your Space (Edit)
    Follow by email »
    Get the latest updates in your email box automatically.
    Loading...
    Subscribe via RSS
    Facebook