Skip to content

Instantly share code, notes, and snippets.

View yusuke's full-sized avatar

Yusuke Yamamoto yusuke

View GitHub Profile
/*
Copyright (c) 2010-2010, Yusuke Yamamoto
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
@yusuke
yusuke / MyFrame.java
Created December 8, 2010 08:09
fooって表示するだけ
import javax.swing.*;
import java.awt.*;
public class MyFrame extends JFrame {
public static void main(String[] args) {
new MyFrame().setVisible(true);
}
JTextArea text = new JTextArea();
MyFrame(){
setSize(100,100);
@yusuke
yusuke / MyFrame.java
Created December 8, 2010 11:37
カウントアップしていく
import javax.swing.*;
import java.awt.*;
public class MyFrame extends JFrame {
public static void main(String[] args) {
new MyFrame().setVisible(true);
}
JTextArea text = new JTextArea();
MyThread thread = new MyThread();
@yusuke
yusuke / JComboBoxExample.java
Created January 27, 2011 01:11
2つのコンボボックスの選択状況を連動させるサンプル
/*
Copyright (c) 2011 Yusuke Yamamoto
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
package frame;
import javax.swing.*;
import java.awt.*;
/**
* Created by IntelliJ IDEA.
* User: white
* Date: 11/01/29
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<?php
require "./tmhOAuth.php";
$twitter = new tmhOAuth(
array("consumer_key" => "consumerkey",
@yusuke
yusuke / gist:854361
Created March 4, 2011 08:56
test.php
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<?php
// initialize tmhOAuth
require "./tmhOAuth.php";
$twitter = new tmhOAuth(array());
GAETwitter extends AsyncTwitter{
public void get(TwitterListener listener);
}
GAETwitter twitter = GAETwitterFacotry.getInstance();
twitter.getPublicTimeline().get(new TwitterAdapter(){
public void gotPublicTimeline(List<Status> statuses){
// do something
}
@yusuke
yusuke / gist:1059878
Created July 2, 2011 09:07
FutureStatus.java
/*
* Copyright 2007 Yusuke Yamamoto
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
HttpClient client = HttpClientFactory.getInstance(ConfigurationContext.getInstance());
HttpResponse res = client.request(new HttpRequest(RequestMethod.GET,"http://api.twitter.com/statuses/show/1000.json", null, null, null));
System.out.println(res.asJSONObject());
System.out.println("--------");
System.out.println(res.asString());
System.out.println("--------");