Pomodoro Controls for AlfredApp

May 11, 2012

An AppleScript so you can control Pomodoro from Alfred App. You will need Alfred and the Powerpackto use this.

Installation

To install Pomodoro Controls in Alfred double click on the extension file.

How to use

Once installed with Alfred you can run the following commands

  • po start  :: To start pomodoro (can also use s or  st)
  • po reset :: To reset pomodoro (can also use re)
  • po resume :: To resume pomodoro
  • po external :: External interrupt (can also use ei)
  • po internal :: Internal interrupt (can also use ii)
  • po force :: To force completion (can also use fc)
  • po help :: Help message (can also use help or ?)
 

[2012-5-12] 

I found the developer removed Pomodoroap from Mac AppStore.  You can the source file of  Podomodo app from https://github.com/ugol/pomodoro

iHappyDays Pro v 2.0

May 4, 2012

오랫만에 iHappyDays Pro v2.0 프로그램이 major upgrade 되었습니다.

음력지원과 주소록 연동하여 기념일 지원하는 기능과 더불어 자체적인 기념일 관리 기능이 추가되었습니다. 각 기념일 별로 Alarm을 별도 설정하는 기능도 추가가 되었습니다.

Ver 2.0 – (2012-05-03) : Only supported iHappyDays Pro version.

  • Clears all reported bugs of previous version
  • Applied user feedback
  • (Add) Supports iOS 5.1 & Retina Display
  • (Add) Anniversary management: add, remove, edit, import, etc
  • (Add) Supports Local notification
  • (Add) Supports D-Day

MarsEdit에서 emacsclient를 사용하기

April 9, 2012

MarsEdit에서 외부 Editor로 Emacs를 지정하니 새로운 instance로 뜨거나 프로그램이 종료되기 전에는 MarsEdit로 작성된 글이 옮겨오지를 않는다. emacsclient를 지정하려니 ODB Protocol을 지원하지 않으면 프로그램에서 설정할 수가 없다. 검색을 해 보니, github에 EditClient라는 ODB protocol을 지원하는 python wrapper가 공개되어 있다.

  • EditClient – A simple shim to use Emacs as an external editor for Mac OS X apps that use the ODB protocol.
  • Compiled version – Icon을 하나 붙여 놓고, 소스 버전을 compile한 binary.

    [2012-04-09 Mon] Lion에서 EditorClient 프로그램을 한번 수행을 해 놓으면 잘 동작을 하는데, 그냥은 emacsclient에서 MarsEdit로 데이타를 옮겨 올 때 죽는다. Log를 살펴보니 encode method 문제라고 나오는데 살펴볼 시간이 없어서 일단은 이렇게 쓰기로 했다.

AlfredTweet 한글 자소 풀림 패치

March 23, 2012

증상

http://farm8.staticflickr.com/7077/7007470163_39924ff61d_o.jpg

http://farm8.staticflickr.com/7073/7007485345_7446e4a659_o.jpg

AlfredTweet에서 posting한글이 WinXP에서 볼 때 자소 단위로 풀어지는 현상을 @gypark님이 알려주셨습니다.

Mac이나 Win7에서는 문제가 없는데 Win XP에서 볼 때에만 풀어서 보이게 됩니다. Mac에서 unicode를 NFD(Normalization Form Decomposition)방식으로 처리하는데 Win XP에서는 이것을 자동으로 NFC로 바꿔주지 못해서 생기는 문제입니다.

AlfredApp 제작자에게 parameter를 넘길때 NFC로 넘기는 Option을 만들어달라는 건의 메일을 보냈는데, extension client에서 처리하는게 나을것 같다는 답장이 왔습니다. Client에서 처리하는게 맞을 것 같기도 하고요.

패치

php-intl module install

Mac Lion에 있는 php는 default로 intl 모듈을 지원하지 않아서, php-intl 모듈을 먼저 활성화 해야 합니다.

Jaemok-Jeong-ui-MacBook-Pro:~ jmjeong$ php -v
PHP 5.3.8 with Suhosin-Patch (cli) (built: Nov 15 2011 15:33:15)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
  • Download and install ICU
tar zxvf icu4c-4_8_1_1-src.tgz
cd icu/source
./configure
make
sudo make install
cd ext/intl
phpize
./configure --enable-intl
make
  • turn on intl.so
in /etc/php.ini
add 'extension=intl.so'
  • 확인
Jaemok-Jeong-ui-MacBook-Pro:~ jmjeong$ php -i | fgrep intl
intl
intl.default_locale => no value => no value
intl.error_level => 0 => 0

AlfredTweet patch

AlfredTweet 1.5 버전에 대한 patch입니다.

diff --git a/script.php b/script.php
index fd6cc14..dd9931d 100755
--- a/script.php
+++ b/script.php
@@ -910,11 +910,15 @@

 // create a new instance
 $tweet = new TwitterOAuth($ckey1, $ckey2, $auth['oAuthKey'], $auth['oAuthSecret']);
-       $tweet_text = $text;
+
+        if (!Normalizer::isNormalized($text, Normalizer::FORM_C)) {
+            $text = Normalizer::normalize($text, Normalizer::FORM_C);
+        }
+        $tweet_text = $text;
 $tweets = array();

 // Check tweet length and break it into multiple tweets if needed.
-       if (strlen($tweet_text) > 140 && $settings->split_tweets == 1) {
+       if (mb_strlen($tweet_text, "utf-8") > 140 && $settings->split_tweets == 1) {

 // Set the regex pattern to grab mentions from the total tweet
 // then grab all mentions as an array, and reassemble as a string.
@@ -940,7 +944,7 @@

 // Check the tweet length with the new word added. Set to 136 instead of 140
 // characters to compensate for the counter at the end.
-               if (strlen($temp) > 136) {
+               if (mb_strlen($temp, "utf-8") > 136) {

 // If its over 136 characters, then break here and make the current value its
 // own tweet. Then reset the $newtweet value with the mentioned users in the 

lun2sol.c

February 24, 2012

기존에 프로그램에서 사용하던 음-양력 변환프로그램에 버그가 있어 날짜가 검증된 라이브러리를 찾다가 python으로 된 루틴을 http://mearie.org/projects/transdate/index.ko 에서 찾았습니다.

C로 된 라이브러리가 필요해서 python 루틴을 C로 변환을 했습니다. Standard C library의 gmtime을 이용하면 더 간단하게 구현할 수 있는데, objective-C에서도 필요해서 fromoridnal부분을 추가했습니다.

iOS5 cydia app 사용

February 8, 2012

iPhone4s에 5.0.1 jailbreak가 나온 후 사용한지 2주 정도 흘렀다. 설치해서 사용하고 있는 Cydia app 목록이다.

http://farm8.staticflickr.com/7003/6834357481_49b20f1396.jpg

사용 중

  • kuaidial, kualdial bitesms plugin(무료) : kuaidial.google.com/svn/deb
    • Call 화면에서 초성검색을 가능하게 하고, 그 외에 부가적으로 call blocking 기능을 제공한다. 유료로 판매하여도 상관없을 정도의 완성도인데, 무료이다.
  • cydelete (무료)
    • Cydia app을 바탕화면에서 지울 수 있게 하는 Tweak
  • stayopened (무료)
    • App Store 프로그램에서 프로그램을 설치할 때 바탕화면으로 나가지 않게 하는 tweak
  • appscenter for notification (무료)
    • Notification center에 application shortcut을 유지하게 하는 tweak
  • winterboard : silent theme (무료)
    • Camera sound를 없애기 위해서 사용
  • multicleaner ($0.99)
    • 백그라운드에서 수행되는 app을 한번에 kill하기 위해서 사용. Status bar에서 가로로 swipe하면 kill all apps를 수행하도록 설정해서 사용 중
  • folderenhance ($4.99)
    • folder 개선 프로그램. 폴더에 들어가는 app 갯수 제한을 없애주고, folder 내에 folder를 넣을 수 있게 해 준다.
  • sbsettings (무료)
    • 시스템 on/off tweak, wifi, bluetooth 등을 on/off 할 때 사용된다
    • push notification toggle : noti on/off
    • push mail sbsettings toggle : mail push on/off
  • nowlistening (무료)
    • 현재 play 중인 음악 목록을 noti로 알려주는 tweak
  • multiIconMover (무료)
    • 여러개의 App Icon을 한꺼번에 옮기게 해주는 tweak
  • bitesms ($6.99)
    • 할인할 때 구입했던 SMS 대체 프로그램
  • intelliscreenx($9.99)
    • Notification center tweak app
  • ifile ($4.99)
    • iOS 파일 관리자
  • openssh (무료)
    • ssh shell 계정으로 접근 가능하게 함
  • callbar($1.99)
    • 전화가 왔을 때 전체화면으로 가리는 대신 bar로 전화 설정 하도록 하는 tweak
  • pwntunes($6.99) – win용 음악 관리자 tweak
    • 유용할 듯 해서 구입했는데, Mac에서는 지원이 되지 않는다. iOS의 music을 여러 PC에서 관리하도록 하는 tweak
  • lsmusicgestures (무료)
    • lock screen gesture로 music play
  • calendar for notification center (무료)
    • notification center에 달력을 보여주는 app
  • anylockapp (무료)
    • camera 버튼에 어플 할당
  • camera locker (무료)
    • camera 버튼을 double click이 아니더라도 항상 보이도록 하는 tweak
  • wicarrier (무료)
    • 현재 연결된 wifi를 carrier 이름대신 보여주는 app
  • nocyfresh (무료) – cydia refresh를 끌 수 있는 tweak
  • action menu plus pack ($1.99)
    • Text 입력 개선, today 날짜를 쉽게 입력하는 tweak을 찾다가 구입
  • last app (무료)
    • 최근 사용된 두개의 app 사이를 오갈수 있게 한 tweak
  • nostorebutton (무료)
    • Music에서 store 버튼 제거
  • NoNewsIsGoodNews (무료)
    • 뉴스스탠드 fodler 제거

써 볼까 검토 중

  • app stat (무료)
    • 각 app의 사용 통계를 보여주는 프로그램. 배터리 소모량에 영향이 있지 않을까 하는 우려로 uninstall 함
  • growlnotifier (무료)
    • notification을 mac의 growl로 표시해주는 app. Growl 1.3.3 에서는 동작확인했는데, battery 소모에 영향이 있는 것 같아서 테스트 후 uninstall
  • my3g (?)
    • 3G에서 20M 이상 자료 받을 수 있게 하는 app
  • iBlackList ($12)
    • Spam 방지 app. Spam Call, SMS를 막는 app
  • pdanet(?) – mywifi 무료 버전
  • financeabler(?)
  • musiccenter for notification(?)
  • music control pro(?)
  • I’m busy SMS – ($2.99) – 지정된 문자 전송
  • anyring ($3.99)
  • snowcover4

iPhone에서 AirPrint 사용하기

November 16, 2011

최근 들어 Air Print 기능을 지원하는 프린터들이 많이 출시되고 있습니다. 회사에서 사용하고 있는 프린터는 지원이 되지 않아서 방법이 없나 찾아 봤는데, Mac(Lion)에 공유된 printer를 Air Print로 지원하게 하는 프로그램들이 있네요.

무료인데다가 iOS에서 메일이나 사진 메모 등의 print도 문제없이 지원되네요. 앞으로 자주 사용하게 될 듯 합니다.

iPhone에 Google Calendar 사용

November 16, 2011

iPhone에서 Google Calendar 사용법을 기록해 둡니다.

요약하면 Microsoft Exchange 설정으로 지정하고 email에 Google 계정 이메일 주소(Google Apps를 사용하는 경우에는 @nemustech.co.k와 같은 App주소)를 설정, 도메인 이름은 비워두고, Server 명에 m.google.com을 입력합니다.

계정에 설정된 공유 calendar는 iPhone 설정 화면에서 지정하지 않고, Safari로 http://m.google.com/sync 로 접속하여 웹에서 지정을 합니다. 언어설정을 English(US)로 변경하면 동기화할 Calendar 목록이 나오게 됩니다.

iPhone 4s

November 16, 2011

23개월간 iPhone 3GS를 사용하다가 이번에 iPhone 4S (32G white)로 변경을 했습니다.
배터리가 일찍 소진된다는 보고, 통화 중 Noise가 난다는 보고를 여러 커뮤니티 사이트에서 봤는데, 다행히도 뽑기운이 좋았는지 큰 문제 없이 사용을 하고 있습니다. 배터리는 좀 빨리 다는 듯한 느낌이 들긴 한데, 주변에 충전할 데가 많아서 그런대로 견디고 있습니다. 이미 iPhone 4에 적용이 되었던 Retina Display를 직접 써 보니 좋긴 하네요.

Dual-core A5 칩은 기대했던 것보다 빠르다는 느낌은 들지 않았습니다. iOS 5.x의 3GS가 생각보다 빠른 속도를 내 주고 있었기 때문인지도 모르겠네요. 기대했던 카메라는 만족스럽지만, 구동속도가 조금만 더 빨라졌으면 하는 바람과 카메라 셔터음 소거 기능(법적인 문제 때문에 불가능하다고 했지만)이 있었으면 하는 생각이 듭니다. 회의 중에 가끔 사진 찍을 일이 있는데 깜짝깜작 놀라고 있습니다. 4S에 들어간 Siri는 재밌는 장난감인데, 영어공부를 열심히 해야겠다는 생각을 들게 합니다. Cancel을 의도하고 발음한 것의 대부분이 Cancer로 인식을 하네요.

RESTful API using django

October 31, 2011

REST API를 지원하는 server가 필요해서 django로 구성 가능한 몇가지 framework(django-piston, django-tasypie, django-rest-framework)을 테스트 해 봤다.

세가지 framework 중에서 django-piston을 이용해서 작업을 했는데, 나중에는 django-rest-framework으로 변환할까 생각중이다.

django-piston

두개의 테이블(user, rule)과 10여개의 API set을 가진 서버를 구성하는데, 반나절 남짓의 작업으로 가능했다. 2011.10월 시점으로 공식적으로 v0.2.2버전이 release 되었다. 개발은 쉽고 편했는데, 2년여간 update가 되지 않았고, 문서가 상대적으로 빈약했다. 최근에 새로운 maintainer가 코드를 인수인계 받아서 update가 기대되고 있다.

urls.py

from piston.resource import Resource
from latte.api.handlers import UserHandler, RuleHandler, RuleSearchOwnerHandler, RuleSearchTargetHandler

class CsrfExemptResource(Resource):
    """A Custom Resource that is csrf exempt"""
    def __init__(self, handler, authentication=None):
        super(CsrfExemptResource, self).__init__(handler, authentication)
        self.csrf_exempt = getattr(self.handler, 'csrf_exempt', True)

user = CsrfExemptResource(UserHandler)

urlpatterns = patterns('',
    url(r'^user/?$', user),
    url(r'^user/(?P<email>[^/]+)/?$', user),
)

handler.py

from piston.handler import BaseHandler, AnonymousBaseHandler
from piston.utils import rc, require_mime, require_extended

from django.contrib.auth.models import User
from latte.api.models import Rule

class UserHandler(BaseHandler):
    """
    EntryPoint for registration
    """

    allowed_methods = ('GET', 'POST', 'DELETE')
    fields = ('email',)

    def read(self, request, email=None):
        """
        """
        if not email:
            return User.objects.filter(is_superuser=False)

        try:
            return User.objects.get(email=email,is_superuser=False)
        except (User.DoesNotExist, KeyError):
            return rc.NOT_FOUND

    def delete(self, request, email=None):
        """
        """
        if not email:
            return rc.BAD_REQUEST

        try:
            user = User.objects.get(email=email,is_superuser=False)
        except (User.DoesNotExist):
            return rc.NOT_FOUND

        user.delete()
        return rc.DELETED

    def create(self, request):
        """
        Process connection : register user with email and password
        """

        if not request.content_type:
            return rc.BAD_REQUEST

        data = request.data

        try:
            user = User.objects.get(username=data['email'])
            return rc.DUPLICATE_ENTRY
        except (User.DoesNotExist, KeyError):
            user = User(username=data['email'], email=data['email'])

        try:
            user.set_password(data['password'])
            user.save()
        except KeyError:
            return rc.BAD_REQUEST

        return rc.CREATED

django-tastypie

v1.0.0-beta 버전이 release 되었다. dehydrate, hydrate function에서 GET과 PUT에 대한 세부적인 제어를 하게 되어 있다.

urls.py

from django.conf.urls.defaults import *
from tastypie.resources import ModelResource
from tastypie.api import Api

from api.resources import UserResource, RuleResource

from django.contrib import admin
admin.autodiscover()

v1_api = Api(api_name='v1')
v1_api.register(UserResource())

urlpatterns = v1_api.urls

resources.py

from django.contrib.auth.models import User
from latte.api.models import Rule

from tastypie.resources import ModelResource
from tastypie.authorization import Authorization
from tastypie import fields
from tastypie import http

class UserResource(ModelResource):
    class Meta:
        queryset = User.objects.filter(is_superuser=False)
        list_allowed_methods = ['get', 'post']
        detail_allowed_methods = ['get', 'post']
        excludes = ['id']
        resource_name = 'user'
        include_resource_uri = False
        authorization = Authorization()
        fields = ['username']

    # def hydrate(self, bundle):
    #     bundle.obj.email = bundle.data['username']

    #     return bundle

    def obj_create(self, bundle, request=None, **kwargs):
        try:
            user = User.objects.get(username=bundle.data['email'])
            return http.HttpConflict()
        except (User.DoesNotExist, KeyError):
            user = User(username=bundle.data['email'], email=bundle.data['email'])

        bundle.obj = user
        return bundle

...

django-rest-framework

앞의 두 framework 대비해서 자동으로 API 접근에 관한 문서를 만들어주는 장점이 있다. Django의 class based view에 기반을 해서 간단하고, 모듈화 된 장점도 있다.

urls.py

from django.conf.urls.defaults import *

from djangorestframework.resources import ModelResource
from djangorestframework.views import ListOrCreateModelView, InstanceModelView

from latte.api.resources import RuleResource
from latte.api.views import TestView

urlpatterns = patterns('',
    url(r'^test/$', TestView.as_view(), name="test"),

    url(r'^rule/$', ListOrCreateModelView.as_view(resource=RuleResource), name="rule-list"),
    url(r'^rule/(?P<pk>[^/]+)/$', InstanceModelView.as_view(resource=RuleResource),
    name="rule-detail"),
...
)

views.py

from django.core.urlresolvers import reverse

from djangorestframework.views import View
from djangorestframework.response import Response
from djangorestframework import status

from latte.api.models import Rule

class TestView(View):
    """
    TestView basic
    """
    # model = Rule
    fields = ('title', 'when', 'where', 'message')

    def get(self, request):
        """
        Handle Get requests
        """

        # print request.data
        return Rule.objects.all()

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org