This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @see http://developer.apple.com/iphone/library/documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/500-DirectInteraction/DirectInteraction.html#//apple_ref/doc/uid/TP40007744-CH6-SW1 */ | |
ABAddressBookRef addressBook = ABAddressBookCreate(); | |
NSLog(@"アドレスブックに何人登録されているか: %d", | |
ABAddressBookGetPersonCount(addressBook)); | |
CFArrayRef people = ABAddressBookCopyArrayOfAllPeople(addressBook); | |
CFMutableArrayRef peopleMutable = CFArrayCreateMutableCopy( | |
kCFAllocatorDefault, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
import kay | |
from kay.management import utils | |
def action_jsdepswrite( | |
media_dir=('m', 'media'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# util.py | |
import tweepy | |
import settings | |
def get_api(): | |
oauth = tweepy.OAuthHandler(settings.CONSUMER_KEY, settings.CONSUMER_SECRET) | |
oauth.set_access_token(settings.ACCESS_TOKEN, settings.ACCESS_TOKEN_SECRET) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# coding: utf-8 | |
import unicodedata | |
def ishirakata(text): | |
text = unicodedata.normalize('NFKD', text) | |
for u in text: | |
name = unicodedata.name(u) | |
if name.startswith("HIRAGANA") or\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KEYWORD="tamori" && curl -N "http://www.google.com/uds/GimageSearch?q=${KEYWORD}&lang=ja&v=1.0" | python -c 'import sys,json;sys.stdout.writelines([u.get("url").encode("ascii")+"\n" for u in json.loads(sys.stdin.read()).get("responseData").get("results")])' | xargs wget -P "${KEYWORD}" | |
# 日本語対応した | |
KEYWORD="森田" && echo "dict(q='${KEYWORD}', lang='ja',v='1.0')" | python -c 'import sys,json,urllib;sys.stdout.writelines([u.get("url").encode("ascii")+"\n" for u in json.loads(urllib.urlopen("http://www.google.com/uds/GimageSearch?"+urllib.urlencode(eval(sys.stdin.read()))).read()).get("responseData").get("results")])' | xargs wget --no-cache -P "${KEYWORD}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# An example hook script for the "post-receive" event. | |
# | |
# The "post-receive" script is run after receive-pack has accepted a pack | |
# and the repository has been updated. It is passed arguments in through | |
# stdin in the form | |
# <oldrev> <newrev> <refname> | |
# For example: | |
# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Yi | |
import Yi.Keymap.Vim (keymapSet) | |
import qualified Yi.Mode.Haskell as Haskell | |
import Yi.Style | |
import Yi.Style.Library | |
import Yi.Prelude | |
import Prelude () | |
-- import Yi.UI.Vty (start) | |
-- import Yi.UI.Cocoa (start) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
tipfyext.tenjin | |
~~~~~~~~~~~~~~~~ | |
pyTenjin template support for Tipfy. | |
Learn more about pyTenjin at http://www.kuwata-lab.com/tenjin/ | |
:copyright: 2010 by tipfy.org. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
フレームワークとして Flask(http://flask.pocoo.org/) を、OAuth ライブラリとして oauth2(http://pypi.python.org/pypi/oauth2/) を利用したサンプルプログラムです。 | |
下のコードを保存して (oauth_consumer.py とします)、YOUR_CONSUMER_KEY, YOUR_CONSUMER_SECRET となっている部分を自分の consumer_key, consumer_secret で置き換えます。 | |
$ python oauth_consumer.py | |
... で起動してから http://localhost:5000 に Web ブラウザでアクセスして下さい。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - | |
#pragma mark Managing the Selection and the Edit Menu | |
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender { | |
UIMenuController *menuController = [UIMenuController sharedMenuController]; | |
[menuController setMenuVisible:NO animated:NO]; | |
if (action == @selector(cut:) || | |
action == @selector(copy:) || |