Skip to content

Instantly share code, notes, and snippets.

View yoshiki's full-sized avatar

Yoshiki Kurihara yoshiki

View GitHub Profile
@yoshiki
yoshiki / appstore.pl
Created February 8, 2011 15:41
fetch app stats from appstore
#!/usr/bin/perl
#
# Product Type Identifier Category Description
# 1 Free or Paid Apps iPhone and iPod Touch
# 7 Updates iPhone and iPod Touch
# IA1 In Apps In-App Purchase
# IA9 In Apps In-App Subscription
# 1F Free or Paid Apps Universal Apps
# 7F Updates Universal Apps
# 1T Free or Paid Apps iPad App
@yoshiki
yoshiki / Auto-Notify.pm
Created January 18, 2011 08:38
For using notifo on tiarra
#+ Auto::Notify {
# mask: *@*
# keyword: foo,bar,baz
# blocks: notifo
# notifo {
# type: notifo
# api-key: yourapikey
# user: yourusername
# format: #(nick.now): #(text)
# }
# png(Imager-0.79/GD-2.45)
Benchmark: timing 100 iterations of G::B::QRcode, I::QRCode::plot, I::QRCode::plot_qrcode...
G::B::QRcode: 1 wallclock secs ( 0.66 usr + 0.02 sys = 0.68 CPU) @ 147.06/s (n=100)
I::QRCode::plot: 0 wallclock secs ( 0.12 usr + 0.02 sys = 0.14 CPU) @ 714.29/s (n=100)
(warning: too few iterations for a reliable count)
I::QRCode::plot_qrcode: 0 wallclock secs ( 0.11 usr + 0.01 sys = 0.12 CPU) @ 833.33/s (n=100)
(warning: too few iterations for a reliable count)
Rate G::B::QRcode I::QRCode::plot I::QRCode::plot_qrcode
G::B::QRcode 147/s -- -79% -82%
I::QRCode::plot 714/s 386% -- -14%
@yoshiki
yoshiki / layout.xml
Created January 12, 2011 09:14
画面下にボタンを配置する
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<WebView
android:id="@+id/web_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
#!perl
my $GIF_DATA = pack "C43", (
0x47, 0x49, 0x46, 0x38, 0x39, 0x61,
0x01, 0x00, 0x01, 0x00, 0x80, 0xff,
0x00, 0xc0, 0xc0, 0xc0, 0x00, 0x00,
0x00, 0x21, 0xf9, 0x04, 0x01, 0x00,
0x00, 0x00, 0x00, 0x2c, 0x00, 0x00,
0x00, 0x00, 0x01, 0x00, 0x01, 0x00,
0x00, 0x02, 0x02, 0x44, 0x01, 0x00,
(defalias 'perl-mode 'cperl-mode)
(autoload 'cperl-mode "cperl-mode" "alternate mode for editing perl script." t)
(add-to-list 'auto-mode-alist '("\\.\\([pP][Llm]\\|al\\|cgi\\|t\\)$" . cperl-mode))
(add-hook 'cperl-mode-hook
(lambda()
(require 'perl-completion)
(perl-completion-mode t)))
(add-hook 'cperl-mode-hook
(lambda ()
@yoshiki
yoshiki / Main.java
Created December 29, 2010 10:12
A Program for fetching app information from android market
import java.io.FileOutputStream;
import com.gc.android.market.api.MarketSession;
import com.gc.android.market.api.MarketSession.Callback;
import com.gc.android.market.api.model.Market.AppsRequest;
import com.gc.android.market.api.model.Market.CommentsRequest;
import com.gc.android.market.api.model.Market.GetImageRequest;
import com.gc.android.market.api.model.Market.GetImageResponse;
import com.gc.android.market.api.model.Market.ResponseContext;
import com.gc.android.market.api.model.Market.GetImageRequest.AppImageUsage;
#!perl
use strict;
use warnings;
use Data::Dumper;
my $ref = {
foo => {
qux => {
quux => 2,
#!/usr/bin/env perl
use strict;
use warnings;
use DateTime;
use DateTime::Format::MySQL;
my %age_of = (
0 => '未就学児',
6 => '小1', 7 => '小2', 8 => '小3', 9 => '小4', 10 => '小5', 11 => '小6',
package Music::DB;
use base qw( Hako );
__PACKAGE__->connection( 'dbi:mysql:dbname', 'username', 'password' );
__PACKAGE__->schema(
artist => {
primary_key => [ qw( id ) ],
columns => [ qw( id name ) ],
},
cd => {