Skip to content

Instantly share code, notes, and snippets.

View hisasann's full-sized avatar
🔖
I aspire to become a bookseller.

Yoshiyuki Hisamatsu hisasann

🔖
I aspire to become a bookseller.
View GitHub Profile
<?php
/*
Template Name: Recent Entries
*/
?><?php
// クエリ文字列
$query = $_GET["re"];
// 検索件数
$allsearch =& new WP_Query("s=".$query."&showposts=-1");
require "rubygems"
require "twitter"
require "date"
require "json"
require "net/http"
require "time"
$KCODE = "UTF8"
class NoTechnoNoLife
@hisasann
hisasann / gist:1378656
Created November 19, 2011 09:39
bit.lyAPIのサンプル.rb
require "rubygems"
require "json"
require "net/http"
def shorten(long_url)
id = 'hisasann'
api_key = 'xxxxx'
query = "longUrl=#{long_url}&login=#{id}&apiKey=#{api_key}&format=json"
result = JSON.parse(Net::HTTP.get("api.bit.ly", "/v3/shorten?#{query}"))
@hisasann
hisasann / instagram_tag.js
Created February 24, 2012 06:16
InstagramのtagAPIを使ってJSONを返すnode.js版プロキシー
var url = require('url'),
https = require('https'),
http = require('http'),
express = require('express');
var recent = '';
var app = express.createServer();
app.set('view options', { layout: false });
app.get('/instagram_tag', function(req, res){
@hisasann
hisasann / WebView.js
Created February 27, 2012 03:39
TitaniumMobileでWebViewを使う方法
var WebView = function() {
// window
var win = Ti.UI.createWindow();
// view
var view = Ti.UI.createView();
// webview
var webview = Ti.UI.createWebView();
webview.url = 'http://www.google.co.jp/';
@hisasann
hisasann / kernel_panic.txt
Created February 27, 2012 06:51
Androidエミュレータを起動したときのMacのエラーログ
Interval Since Last Panic Report: 239584 sec
Panics Since Last Report: 1
Anonymous UUID: 9F8EF9E2-DFBB-4DF4-89E0-893027276987
Mon Feb 27 13:49:40 2012
panic(cpu 4 caller 0xffffff80002c207e): "kernel_trap(0xffffff8017726390) with 32-bit state"@/SourceCache/xnu/xnu-1699.24.8/osfmk/i386/trap.c:586
Backtrace (CPU 4), Frame : Return Address
0xffffff8017726140 : 0xffffff8000220702
0xffffff80177261c0 : 0xffffff80002c207e
0xffffff8017726360 : 0xffffff80002d7a1d
@hisasann
hisasann / app.js
Created March 5, 2012 07:28
TitaniumMobileでカメラを使う方法
Titanium.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow({
title : 'Tab 1',
backgroundColor : '#fff'
});
var view = Titanium.UI.createView({
backgroundColor : '#fff',
left : 0,
@hisasann
hisasann / AndroidManifest.xml
Created March 5, 2012 08:26
AndroidManifest.xmlのサンプル、縦固定などなど。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hisasann.Hoge" android:versionCode="1"
android:versionName="1">
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
@hisasann
hisasann / cookieCountUp.php
Created March 7, 2012 06:33
クッキーにセットした値をカウントアップします。
<?php
if( isset($_COOKIE['count']) ){
$count = $_COOKIE['count'];
} else {
$count = 0;
}
$count++;
setcookie('count', $count);
@hisasann
hisasann / 0.1+0.2=0.3じゃない.html
Created April 16, 2012 03:09
0.1+0.2=0.3じゃないんだなぁ。
<script type="text/javascript" charset="utf-8">
console.log(0.1 + 0.2); // 0.30000000000000004
</script>