Skip to content

Instantly share code, notes, and snippets.

View kzsg's full-sized avatar

Kazushige Morimoto kzsg

View GitHub Profile
def ui_user_interface_idiom
if UIDevice.currentDevice.respondsToSelector("userInterfaceIdiom")
UIDevice.currentDevice.userInterfaceIdiom
else
UIUserInterfaceIdiomPhone
end
end
- (void)createAdView {
self.adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
adView.requiredContentSizeIdentifiers =
[NSSet setWithObjects:ADBannerContentSizeIdentifier320x50,
ADBannerContentSizeIdentifier480x32,
nil];
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier320x50;
adView.delegate = self;
[self.view addSubview:adView];
}
We couldn’t find that file to show.
// Safariをシングルウィンドウモードにする
defaults write com.apple.Safari TargetedClicksCreateTabs -bool true
// MagicMouseの慣性スクロールをLeopardでも可能にする
defaults write com.apple.driver.AppleBluetoothMultitouch.mouse MouseMomentumScroll -bool true
// ユーザーがログアウトしている状態でもオートマウント機構が作動するよう設定する
// ログアウトした状態でもTimeMachineでバックアップするために必要
defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool yes
// ユーザーがログアウトすると、ディスクをアンマウントするように設定する
@kzsg
kzsg / .ck.config.js
Created October 7, 2008 07:51
.ck.config.js
app.Env("CYGWIN") = "nontsec";
app.Env("LANG") = "ja_JP.Shift_JIS";
app.Env("LC_ALL") = "ja_JP.Shift_JIS";
Config.tty.execute_command = "/bin/bash --login -i";
Config.tty.title = "ck";
Config.tty.savelines = 1000;
Config.tty.input_encoding = Encoding.SJIS;
Config.tty.display_encoding = Encoding.SJIS | Encoding.EUCJP | Encoding.UTF8;
Config.tty.scroll_key = 1;
CmdUtils.CreateCommand({
service: "http://",
name: "scuttle",
homepage: "http://gist.github.com/13428",
author: {name: "kzsg", homepage: "http://kzsg.kurosemi.com"},
description: "search the bookmark from your Scuttle.",
takes: {"query": noun_arb_text},
preview: function( pblock, query) {
@kzsg
kzsg / kurosemi.js
Created September 28, 2008 06:59
kurosemi.comで運用しているscuttleのbookmarkをタグ名で検索します
CmdUtils.CreateCommand({
service: "http://bookmark.kurosemi.com",
name: "kurosemi",
homepage: "http://gist.github.com/13422",
author: {name: "kzsg", homepage: "http://kzsg.kurosemi.com"},
description: "search the bookmark from your Scuttle.",
takes: {"query": noun_arb_text},
preview: function( pblock, query) {
var newtab = gBrowser.addTab('');
gBrowser.selectedTab = newtab;
/*
var Y_MAX = "99999";
var X_MAX = "99999";
initialize();
*/
function PalindromeFinder(x, y) {
this.Y_MAX = x;
this.X_MAX = y;
this.doit = function(){
@kzsg
kzsg / if-else.php
Created September 13, 2008 01:49
elseif elseif elseif ...
if (!($posteduser) || !($_POST['password']) || !($_POST['email'])) {
$tplVars['error'] = T_('You <em>must</em> enter a username, password and e-mail address.') ;
// Check if username is reserved
} elseif ($userservice->isReserved($posteduser)) {
$tplVars['error'] = T_('This username has been reserved, please make another choice.') ;
// Check if username already exists
} elseif ($userservice->getUserByUsername($posteduser)) {