Skip to content

Instantly share code, notes, and snippets.

View ojimac's full-sized avatar

Keita Ojima ojimac

View GitHub Profile
@ojimac
ojimac / gist:2866333
Created June 4, 2012 04:21
HTTPリクエストした先がBasic認証かかっていたときの対処@TitaniumMobile
// 参考 : http://boydlee.com/appcelerator-titanium/basic-authentication-with-titanium-httpclient-and-json.html
xhr = Ti.Network.createHTTPClient();
xhr.onload = function() {
// snip
};
xhr.onerror = function() {
// snip
};
xhr.open('POST', 'http://example.com');
// 1
$(document.ready(function() {
// snip
});
// 2
window.onload = function() {
// snip
};
@ojimac
ojimac / gist:6201094
Last active December 20, 2015 21:58
iOSまわりのUnitTest環境について

t2study #6

  • もくもく会

やったことそれぞれ発表

  • @fukayatsu
  • js-yaml…yamlをjsでパース
@ojimac
ojimac / cocoapods-update.md
Created March 13, 2013 02:02
CocoaPodsのアップデート

いつも忘れるのでメモ

$ sudo gem update --system
$ sudo gem update cocoapods
$ pod --version
0.16.4 # バージョン番号が表示される
#ifdef DEBUG
# define LOG(fmt, ...) {NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);}
# define ELOG(err) {if(err) DLog(@"%@", err)}
#else
# define LOG(...)
# define ELOG(err)
#endif
@ojimac
ojimac / s3-add-cache-header.rb
Created December 7, 2012 02:32
s3のオブジェクトにたいしてキャッシュ用ヘッダ付与
#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
require 'rubygems'
require 'aws/s3'
# コネクションを作成
AWS::S3::Base.establish_connection!(
:access_key_id => ACCESS_KEY_ID,
:secret_access_key => SECRET_ACCESS_KEY
@ojimac
ojimac / gist:3846662
Created October 7, 2012 00:43
githubのorganizationをfollowする
$.post("https://github.com/users/follow?target=organizationName");
@ojimac
ojimac / gist:3300256
Created August 9, 2012 01:49
Facebook認証しているwebアプリでダイレクト後についてくるハッシュを消す
if (window.location.hash === '#_=_') {
window.location.hash = '';
}