Month: พฤษภาคม 2009

มาลอง พัฒนา Application ร่วมกับ Git กันเถอะ (1)

 - by NAzT

คืออะไร ? ว่าง่ายๆ ก็คือ opensource  ที่ใช้เป็น version control system นั่นแหละครับ หรือ นิยามเต็มๆ ก็คือ

Git is a free & open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Every Git clone is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server.Branching and merging are fast and easy to do. Git is used for version control of files, much like tools such as MercurialBazaarSubversionCVSPerforce, andVisual SourceSafe. อ้างจาก   http://git-scm.com/

พอพูดถึงนิยามไปแล้ว เรามาลองใช้ git กันเลยดีกว่า

  1. เราต้องติดตั้ง git ก่อน (Download and install Git )
  2. ทดลองสร้าง Directory หรือไฟล์ ดังนี้ $ mkdir ProjectName $ cd ProjectName $ touch README
  3. สั่ง git init  เพื่อสร้าง repository $ git init
  4. เมื่อสร้างไฟล์ใดๆแล้วให้สั่ง git add ชื่อไฟล์ หรือถ้าต้องการ add ทั้งหมดก็สั่ง git add . ได้เลย $ git add .
  5. เมื่อทำอะไรเรียบร้อยแล้วก็ต้องยืนยันการกระทำโดยสั่ง git commit -m ‘COMMENT’ $ git commit -m ‘First Commit README added)
  6. ถ้าต้องการสร้าง branch ใหม่ก็สั่ง git branch branchname $ git branch newbranch
  7. ต้องการ switch branch ก็สั่ง git check branchname $ git checkout newbranch $ git branch

ตามไปดู ตัวอย่างการใช้งานจริงได้ที่  VDO การพัฒนา Grails application ร่วมกับ Git เพื่อเพิ่ม productivity ก็ได้คร้าบบ

คราวหน้ามาพูดถึง github กันครับ

[Note]-Google Wave

 - by NAzT

วันนี้เปิด twitter มา ก็เห็น tag # ก็ลองไปเปิดๆ search ๆ  ดู  แล้วก็ไปดู clip vdo ที่ http://wave.google.com/

พอดูแล้ว …​ เฮ้ย  เจ๋งดี   เหมือนกับว่า  google  สร้าง googlewave ขึ้นมาโดยใช้ product เดิม   อย่างเช่น  , gdocs, gtalk ….. ทั้งหลายทั้งปวง

ทำให้ เราสามารถทำงาน ร่วมกัน … คุยกัน ใช้ชีวิตประจำวันด้วยกัน ….​ realtime โคตรๆ ชอบๆ

Google Wave is a new tool for communication and collaboration on the web, coming later this year. Watch the demo video below, sign up for updates and learn more about how to develop with Google Wave.

From wave.google.com

http://wave.google.com/ Went Walkabout. Brought back Google Wave. http://googleblog.blogspot.com/2009/05/wen…oogle-wave.html Introducing the Google Wave APIs: what can you build? http://googlewavedev.blogspot.com/2009/05/…s-what-can.html Google Wave Federation Protocol http://www.waveprotocol.org/

http://wave.google.com/

Related Blogs

[Shell Script] ค้นหาไฟล์ ลบไฟล์ ที่เลยมาแล้ว 10 นาที

 - by NAzT

ตัวอย่างนี้จะส่ง ls -l เมื่อเจอไฟล์ที่มีอายุ 15 นาทีขึ้นไป

$ find ~/_LOCKS_FILE/ -mmin +15 -type f -exec ls -l {} \;

อันนี้จะลบไฟล์ที่มีอายุ 3 วันขึ้นไป

$ find /u1/database/prod/arch -type f -mtime +3 -exec rm {} \;

Related Blogs

[Twitter] Follow กลับ คนที่มา Follow เรา

 - by NAzT

​Script Follow กลับ ด้าวยภาษา ruby

ก่อนอื่นต้องลง twitter gem ด้วยคำสั่ง sudo gem install twitter (อย่าลืมอัพเดต ก่อนด้วยนะ)

ไฟล์ มีหน้าตาเป็นแบบนี้นะ FILE (.twitter)

email: my_twitter_email password: my_twitter_password

#!/usr/bin/env ruby
require 'rubygems'
require 'twitter'

config = YAML::load(open(".twitter")) httpauth = Twitter::HTTPAuth.new(config['email'], config['password']) = Twitter::.new(httpauth)

base.followers.each do |follower| if !follower.following begin base.friendship_create(follower.id, true) rescue puts "An error occurred: #{$!}" end puts "Created friendship with #{follower.screen_name}" end end ได้มาจาก http://travisonrails.com/2009/04/22/Twitter-Gem-Examples

Related Blogs

วิธีลบ Quicksilver

 - by NAzT

วิธีลบ Quicksilver หรือ reset

503  sudo rm -rfv ~/Library/Application\ Support/Quicksilver/ 504  sudo rm ~/Library/Preferences/com.blacktree.Quicksilver.plist

Related Blogs

update Twitter ด้วย twitter.lib.php ทำงานบน Shell

 - by NAzT

พอดีต้องทำงานเกี่ยวกับการเอาข้อมูลไปลง twitter เลยต้องหา library มาลอง ลองไปลองมาหลายภาษา ได้ถูกใจก็ twitter.lib. เนี่ยแหละ ซึ่ง สนใจไปดูได้ที่ http://apiwiki.twitter.com/Libraries

แต่พอดีอยาก tweet แล้วขี้เกียจพิมพ์ tag เอง … เลย ทำ script เพื่อให้มันใส่ tag ให้เลย (ข้างล่าง)

$twitter=InputAndLoginToTwitter();
echo "Enter Tag : ";
$tag = fgets (STDIN, 1024);
while(1)
{
    print "Update  : ";
    $stdin = fgets (STDIN, 1024);
    $update=$twitter->updateStatus(trim((string)$stdin) . " " . trim($tag));
    if($twitter->http_status!=200)
    {
        $error_code=$twitter->http_status;
        $ = new SimpleXMLElement($update);
        printf("ERROR %d : %s\n",$error_code,$->error);
        if($error_code==401) // Could not authenticate you.
        {
            $twitter=InputAndLoginToTwitter();
        }
        else
        {
            exit($error_code);
        }
    }
    else
    {
        echo "Update Completed!\n";
    }
}
function InputAndLoginToTwitter()
{
    echo "Enter Username : ";
    $username = fgets (STDIN, 1024);
    echo "Enter Password : ";
    $password = fgets (STDIN, 1024);
    return $twitter = new Twitter(trim($username),trim($password));
} Read this article »

ความหมายของคำว่า Chillax

 - by NAzT

จาก The Online Slang Dictionary

Chillax

  • Chillax: a combination of “chill” and “relax.” “Chill” means to kick back; relax. “Relax”; that’s self-explanatory.
  • To relax. Orgin: Combination of “chill” and “relax.”

Example :

  • I was just chillaxing all day yesterday.
  • I’m chillaxing right now…

Related Blogs

[code] อัพโหลดภาพเข้า twitpic โดยใช้ api

 - by NAzT

[code] อัพโหลดภาพเข้า twitpic โดยใช้ api จะใช้

ซึ่ง จาก function จะ input username ,password , filepath

function postTwitpic($username='',$password='',$filepath='')
{
    $postfields = ();
    $postfields['username'] = $username;
    $postfields['password'] =  $password;
    $postfields['media'] = "@$filepath";
    $twitter_url = 'http://twitpic.com/api/upload';
    $curl = curl_init();
    curl_setopt($curl, _CONNECTTIMEOUT, 2);
    curl_setopt($curl, _HEADER, false);
    curl_setopt($curl, _RETURNTRANSFER, 1);
    curl_setopt($curl, _BINARYTRANSFER, 1);
    curl_setopt($curl, _URL, $twitter_url);
    curl_setopt($curl, _POST, 3);
    curl_setopt($curl, _POSTFIELDS, $postfields);
    $result = curl_exec($curl);
    curl_close($curl);
    $login_ = new SimpleXMLElement($result);
    if (isset($login_->error)) {
        print_r($login_);
        return false;
    } else
    {
        return $login_;
    }
}
function return message ที่โพส ยังไง print_r ดูได้ครับ

NPDigger Groups (google)

 - by NAzT

NPDigger เปิด  NPDigger groups แล้วครับ (เป็น )

สามารถเข้าไปพูดคุย ตอบปัญหา หรือ  Download File  ได้เลยครับ

เข้าไปที่  http://groups.google.com/group/npdigger

picture-5

Related Blogs