Skip to content

Instantly share code, notes, and snippets.

View nutti's full-sized avatar

nutti nutti

View GitHub Profile
@nutti
nutti / get_contrib_list_with_secret.js
Created February 17, 2015 12:44
Qiitaから特定ユーザの投稿の一覧を取得する(限定共有投稿も取得)
var user = 'YOUR_NAME'; // ユーザ名
var access_token = 'YOUR_ACCESS_TOKEN'; // アクセストークン
$.ajax({
url: 'https://qiita.com/api/v1/users/' + user + '/items?token=' + access_token,
type: 'GET',
dataType: 'json',
scriptCharset: 'utf-8',
success: function(res) {
// 成功した時の処理
@nutti
nutti / install_phonegap_plugin.sh
Last active August 29, 2015 14:15
[PhoneGap/Cordova] 古いバージョンのプラグインをインストールする方法 ref: http://qiita.com/nutti/items/0b31939dc9a815d763aa
$ cordova plugin add [プラグインのID]
@nutti
nutti / event_listener.js
Created February 23, 2015 12:58
InAppBrowser Event Listener
self.cb = window.open(url, '_blank', 'location=no,toolbar=no,clearsessioncache=yes');
self.cb.addEventListener('loadstart', function(e) {
var loc = e.url;
if (loc.indexOf(REDIRECT_URL) != -1) {
// 認可完了後の処理
return;
}
});
@nutti
nutti / qiita_access_token.js
Last active August 29, 2015 14:16
[PhoneGap] Get OAuth's access token in Qiita
var params = {
'client_id': clientID, // 登録したアプリのクライアントID
'client_secret': clientSecret, // 登録したアプリのクライアントシークレット
'code': code // リダイレクトURLのクエリのcodeの値
};
$.ajax({
url: getAPIURL('https://qiita.com/api/v2/access_tokens'),
type: 'POST',
headers: {
@nutti
nutti / marked_usage.html
Created February 25, 2015 12:18
[Javascript] marked.js
<script type="text/javascript" src="marked.js"></script>
@nutti
nutti / highlight_usage.html
Last active August 29, 2015 14:16
[Javascript] highlight.js
<link rel="stylesheet" href="css/ext/github.css" type="text/css" />
<script type="text/javascript" src="js/ext/highlight.pack.js"></script>
@nutti
nutti / marked_and_highlight.js
Created February 25, 2015 12:25
[Javascript] marked.js and highlight.js
marked.setOptions({
langPrefix: ''
});
var html = marked(src);
$('#src').html(html);
$('#src pre code').each(function(i, block) {
hljs.highlightBlock(block, block.className);
});
@nutti
nutti / onsenui.js.diff
Created March 16, 2015 12:28
[Onsen UI] Fix bug: Focus on input (filled with text) pushes cursor out of bounds
// Don't send a synthetic click to disabled inputs (issue #62)
case 'button':
case 'select':
+ if (target.disabled) {
+ return true;
+ }
+ break;
case 'textarea':
- if (target.disabled) {
- return true;
@nutti
nutti / github.css.diff
Created March 16, 2015 12:31
[Javascript] Fix bug: output source code from highlight.js is overflowed
@@ -6,11 +6,13 @@ github.com style (c) Vasily Polovnyov <[email protected]>
.hljs {
display: block;
+ word-wrap: break-word;
overflow-x: auto;
padding: 0.5em;
color: #333;
background: #f8f8f8;
-webkit-text-size-adjust: none;
@nutti
nutti / display_ad.js
Created March 17, 2015 23:11
[Unity] Unityからnendの広告を表示させる方法 ref: http://qiita.com/nutti/items/b337736184c56c3203d1
GetComponent(Nend_Ad_Banner_Controller).OnScreenChanged();