#{茶男與藍牌}
Life has to be exciting.
  • Me
  • Online Tools.

Command-Line Javascript (CLI) On Mac OS-X

By 茶男 On 01/02/2012 · Leave a Comment

from http://www.freshblurbs.com/command-line-javascript-cli-mac-os-x

With the increasing popularity of server-side Javascript, you may want to have Javascript everywhere. You can use Javascript outside of a browser, on any platform. There are many choices: you can install Mozilla SpiderMonkey, Google V8 or Mozilla Rhino. If you are like me and use Mac OS-X as your development machine, however, you [...]

Continue Reading →

Firefox input and button have extra hidden space which make the height different from other browsers

By 茶男 On 19/12/2011 · Leave a Comment

To remove the extra hidden space which turns out to be border:

input[type="submit"]::-moz-focus-inner, button::-moz-focus-inner {border:0;}

reference:

http://christophzillgens.com/en/articles/equal-height-input-and-button-elements-in-firefox-and-safari

Continue Reading →

Make compass working with sass in rails3.1

By 茶男 On 13/12/2011 · Leave a Comment

Add the following to your application.rb

class Application < Rails::Application   config.sass.load_paths << “#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets”   config.sass.load_paths << “#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/blueprint/stylesheets” end

Continue Reading →

Hackintosh: sonic boom (system noise) after installed voodoohda 2.7.2

By 茶男 On 26/11/2011 · Leave a Comment

Go to “Utilities”, open “Audio MIDI Setup”, change format to “2ch-16bit integer”, better now.

Continue Reading →

HOW-TO: git reset submodule

By 茶男 On 18/11/2011 · Leave a Comment

execute `git diff $path_to_submodule`, you should be able to see something like

-Subproject commit 7e5b9b0b89ebf56e71e161f8acfab1c95ce8e… +Subproject commit 7185f8e6850272c3224fe7b6ff44bcbc4fb0e…

then copy the commit hash in the first line

execute

cd $path_to_submodule git checkout 7e5b9b0b89ebf56e71e161f8acfab1c95ce8e…

done.

Continue Reading →

Homebrew install specific version of formula?

By 茶男 On 15/11/2011 · Leave a Comment

from http://stackoverflow.com/questions/3987683/homebrew-install-specific-version-of-formula

Since the whole formula directory is a git repository, one can install specific versions using plain git commands.

First, we’ll need to find a commit where postgresql 8.4.4 was available. One way to do this is using git log. (I assume we are in the base directory of homebrew. Probably /usr/local.)

$ git log -S’8.4.4′ — [...]

Continue Reading →

How to Enable Local SMTP (Postfix) on OS-X Leopard

By 茶男 On 08/11/2011 · Leave a Comment

also apply to OS-X Lion.

from http://www.freshblurbs.com/how-enable-local-smtp-postfix-os-x-leopard

OS-X Leopard comes pre-installed with a Postfix version. No need to install it via darwin ports or other such mess (actually uninstall it if you have previously manually installed it via ports or something similar). Postfix just needs to be enabled and following sequence of several easy steps explains [...]

Continue Reading →

escape colon in bash completion

By 茶男 On 02/11/2011 · Leave a Comment

from http://stackoverflow.com/questions/2805412/bash-completion-for-maven-escapes-colon

From Bash FAQ E13.

Just after the complete command in the script you linked to, issue this command to remove the colon from the list of completion word break characters:

COMP_WORDBREAKS=${COMP_WORDBREAKS//:}

Continue Reading →

warning: toplevel constant XX referenced by YY::XX (review)

By 茶男 On 01/11/2011 · Leave a Comment

When I try to move the Devise stuff into a module User::Devise and include it in class User, I got this warning ‘warning: toplevel constant Devise referenced by User::Devise’

Please see the code before and after for a solution.

Solution is to make User::Devise before you do the include for class User

 

Continue Reading →

Discover ActiveRecord: cast an object to specified class

By 茶男 On 28/10/2011 · 1 Comment

Can’t find anything about casting an instance to specified class? Of cause, in Ruby, there is no such concept that you need to cast an instance in most of the cases. But how about you need to? Here is the answer:

By using ActiveRecord::Persistence.becomes, you can easily cast it to specified class.

For example:

 

Continue Reading →
← Previous Entries
  • Categories

    • .NET
    • ActiveRecord
    • Apache
    • Application Server
    • Browser
    • Cantonese
    • CSS
    • Database
    • English
    • General
    • Git
    • IT
    • Java
    • Javascript
    • Linux
    • Mac
    • MySql
    • PHP
    • PostgreSQL
    • Practical Source Code
    • Reflection
    • Ruby
    • SQL
    • Test
    • UI
    • Web
  • Articles

    • February 2012
    • December 2011
    • November 2011
    • October 2011
    • September 2011
    • August 2011
    • June 2011
    • May 2011
    • April 2011
    • March 2011
    • February 2011
    • January 2011
    • December 2010
    • November 2010
    • October 2010
    • September 2010
    • August 2010
    • July 2010
    • June 2010
    • April 2010
    • March 2010
    • February 2010
    • January 2010
    • December 2009
    • November 2009
    • October 2009
    • September 2009
    • August 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • September 2008
  • Calendar

    February 2012
    M T W T F S S
    « Dec    
     12345
    6789101112
    13141516171819
    20212223242526
    272829  
  • Meta

    • Log in
    • Entries (RSS)
" OK Go, innovating music video, out of your imagination! http://t.co/n3y3e0k4 " — chentianwen

#{茶男與藍牌}

Pages

  • Me
  • Online Tools.

The Latest

  • Command-Line Javascript (CLI) On Mac OS-X
    from http://www.freshblurbs.com/command-line-javascript-cli-mac-os-x With the increasing popularity of server-side Javascript, you may want to […]

More

Thanks for dropping by! Feel free to join the discussion by leaving comments, and stay updated by subscribing to the RSS feed.
© 2011 ${茶男與藍牌}
PlatformPro by PageLines