Skip to content

Instantly share code, notes, and snippets.

View shunsuke0125's full-sized avatar

Shunsuke Ishida shunsuke0125

View GitHub Profile
@shunsuke0125
shunsuke0125 / Twitter4jSampleMain
Created April 27, 2014 16:50
Twitter4j を用いたシンプルな実装例 (2014/04/28 01:46:00 動作確認済み)
package com.example;
import java.util.List;
import twitter4j.Status;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.conf.ConfigurationBuilder;
@shunsuke0125
shunsuke0125 / main.m
Created February 24, 2014 04:39
【Objective-C】特権ユーザーとしてアプリケーションを再実行するサンプル
// ====
// 特権ユーザーとしてアプリケーションを再実行するサンプル
// - アプリケーション実行時に特権ユーザーの認証ダイアログが表示されます
// - 認証後に特権ユーザーとして自身を起動します
// - 本サンプルは非特権ユーザーのアプリケーションは終了させずに戻り値を取得しています
//
// (参考)
// Authorization Services C Reference | Mac Developer Library
// https://developer.apple.com/library/mac/documentation/Security/Reference/authorization_ref/Reference/reference.html
// ====
@shunsuke0125
shunsuke0125 / HttpRequestDelegate.h
Last active November 29, 2021 12:16
【Objective-C】HTTPリクエストサンプル
#import <Foundation/Foundation.h>
#define TIMEOUT_INTERVAL 10
@interface HttpRequestDelegate : NSObject<NSURLConnectionDelegate> {
NSURLConnection *connection;
NSMutableData *receivedData;
NSURLResponse *responseData;
BOOL synchronousOperationComplete;
}
@shunsuke0125
shunsuke0125 / Application.cpp
Created March 25, 2013 03:52
Windowアプリケーションで通知領域にアイコンを常駐させる処理
// 自動生成されるInitInstance関数
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) {
HWND hWnd;
// グローバル変数にインスタンス処理を設定する
hInst = hInstance;
// ウィンドウを生成する
hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
// 通知領域にアイコンを追加する
NOTIFYICONDATA notif;