Skip to content

Instantly share code, notes, and snippets.

View akkunchoi's full-sized avatar

Akiyoshi Tanaka akkunchoi

View GitHub Profile
require 'rubygems'
require 'net/imap'
require 'kconv'
require 'pit'
require 'logger'
class ImapFetcher
def initialize(pit_name)
@pit = Pit.get(
@jwage
jwage / SplClassLoader.php
Last active April 9, 2024 21:04
Add MIT license.
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
require 'open-uri'
require 'net/http'
# example with a Flickr image
require 'flickraw'
FlickRaw.api_key=FLICKR_API_KEY
FlickRaw.shared_secret=FLICKR_SECRET
# grab the most interesting unrestricted image from Flickr
photos = flickr.photos.search :per_page => 1, :page => 1, :content_type => 1, :license => 7, :sort => 'interestingness-desc'
@esehara
esehara / gist:1325133
Created October 29, 2011 21:45
Life Music (Life Game like Music Composer)
# -*- coding:utf-8 -*-
import pygame
from pygame.locals import *
import pygame.mixer
import sys
import copy
import array
sounds = [0 for j in range(0,20)]
cell = [[0 for j in range(0,20)] for i in range(0,20)]
@daneko
daneko / PHPUnit_vfsStream_memo.php
Created November 18, 2011 14:34
PHPUnit vfsStreamの使用方法メモ
<?php
require_once 'PHPUnit/Framework/TestCase.php';
require_once 'vfsStream/vfsStream.php';
// require_once 'hoge.php';
/**
* ファイルシステムのテストに関してはURL参照
* とりあえずざっくり使う方法メモ
* @see http://www.phpunit.de/manual/3.6/ja/test-doubles.html#test-doubles.mocking-the-filesystem.examples.ExampleTest.php
@mshibuya
mshibuya / rails_admin.ja.yml
Last active November 2, 2022 09:39
Japanese translation for RailsAdmin
ja:
admin:
js:
true: True
false: False
is_present: 存在する
is_blank: 空白
date: 日付 ...
between_and_: ... から ...
today: 今日
require 'rubygems'
require 'net/imap'
require 'kconv'
require 'pit'
require 'logger'
class ImapFetcher
def initialize(pit_name)
@pit = Pit.get(
@bennylope
bennylope / gist:1894706
Created February 23, 2012 19:50
Canonical URLs with Jekyll
<link rel="canonical" href="http://yourdomain.com{{ page.url | replace:'index.html','' }}" />
use strict;
use warnings;
use Time::HiRes qw/time/;
use Term::ANSIColor;
$SIG{INT} = 'print_score';
my $from = defined $ARGV[0] ? $ARGV[0] : 100;
my $to = defined $ARGV[1] ? $ARGV[1] : 999;
die "Need from <= to ($from > $to)" if($from > $to);