Skip to content

Instantly share code, notes, and snippets.

View withgod's full-sized avatar
💭
I may be slow to respond.

takumi withgod

💭
I may be slow to respond.
View GitHub Profile
@withgod
withgod / gist:748086
Created December 20, 2010 06:26
oauth uploader sample
<?php
require_once "Services/OAuthUploader.php";
$oauth = new HTTP_OAuth_Consumer('APP KEY', 'APP SECRET', 'TOKEN', 'SECRET');
$uploader = Services_OAuthUploader::factory('yfrog', $oauth);
//twitpic require api key http://dev.twitpic.com/apps/new
//$uploader = Services_OAuthUploader::factory('twitpic', $this->oauth, 'apiKey');
//proxy
//$req = new HTTP_Request2();
@withgod
withgod / gist:762362
Created January 2, 2011 06:59
php curlを使ったgoogle calendar 新規作成の実装
<?php
function doReq($url, $param = null, $auth = null, $atomreq = null) {
//var_dump(array($url, $param, $auth));
$header = array();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
@withgod
withgod / gist:762363
Created January 2, 2011 07:02
php http_request2を使ったgoogle calendar 新規作成の実装
<?php
require_once 'HTTP/Request2.php';
function doReq($url, $param = null, $auth = null, $atomreq = null, $debug = false) {
//var_dump(array($url, $param, $auth));
$header = array();
$req = mkReq();
$req->setUrl($url);
if ($param != null) {
$req->setMethod("POST");
@withgod
withgod / gist:762364
Created January 2, 2011 07:03
php curlを使ったpicasaのアルバム作成の実装
<?php
function doReq($url, $param = null, $auth = null, $atomreq = null) {
//var_dump(array($url, $param, $auth));
$header = array();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
@withgod
withgod / gist:762367
Created January 2, 2011 07:07
commons-httpclient3 を使ったgoogle calendar新規作成の実装
package withgod;
import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.StringRequestEntity;
import org.apache.commons.httpclient.params.HttpClientParams;
import org.apache.commons.httpclient.params.HttpMethodParams;
import java.util.regex.Matcher;
@withgod
withgod / gist:873791
Created March 17, 2011 03:41
Growl::Any test
#!/usr/bin/perl
use Growl::Any;
my $growl = Growl::Any->new("my app", ["event1", "event2"]);
$growl->notify("event1", "title", "message");
@withgod
withgod / waffuru
Created March 24, 2011 07:19
waffuru
use waffuru;
print Oppai;
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 19 2011 13:30:39)MacOS X (unix) 版適用済パッチ: 1-315
macvim-kaoriya latest
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 19 2011 13:30:39)MacOS X (unix) 版適用済パッチ: 1-315
macvim-kaoriya latest again
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun 24 2011 20:00:09)
Compiled by root@apple.com
mac os x lion