Skip to content

Instantly share code, notes, and snippets.

View jugyo's full-sized avatar
🏠
Working from home

Kaz jugyo

🏠
Working from home
  • The League
  • New Jersey
View GitHub Profile
@jugyo
jugyo / gist:7440
Created August 27, 2008 06:34
Amazon ECS Sesarch
import urllib
import cgi
import wsgiref.handlers
import os
from google.appengine.api import urlfetch
from google.appengine.ext.webapp import template
from google.appengine.ext import webapp
class Amazon(webapp.RequestHandler):
@jugyo
jugyo / gist:7445
Created August 27, 2008 08:00
logging
import logging
...
logging.debug('debug message')
...
def main():
logging.getLogger().setLevel(logging.DEBUG)
class Test:
@classmethod
def test(self):
""" クラスメソッド
"""
print 'test'
@classmethod
def test2(self):
""" クラスメソッド2
<?php
$base_url = 'http://localhost/piki/';
$admin_name = 'admin';
$admin_password = 'password';
$db = null;
function logger($message) {
error_log(date('Y-m-d H:i:s') . ': ' . $message . "\n", 3, 'piki.log');
}
require 'RNotify'
def rnotify(title, message, timeout_sec = 5)
Notify.init('rnotify')
test = Notify::Notification.new( "Test 1", "This is a test", nil, nil )
test.timeout= timeout_sec * 1000
test.show
sleep(timeout_sec)
test.close
Notify.uninit
// ==UserScript==
// @name eee_google_reader
// @description Google Reader for eeePC
// @include https://*.google.com/reader/view/*
// @include http://*.google.com/reader/view/*
// @include htt*://*.google.*/reader/view*
// @author jugyo (http://jugyo.org/)
// ==/UserScript==
var myStyle = document.createElement('style');
require 'rubygems'
#gem "dm-core", "=0.9.7" #=> error!
#gem "dm-core", "=0.9.8" #=> error!
require 'dm-core'
DataMapper.setup(
:default,
"sqlite3:///#{File.expand_path(File.dirname(__FILE__))}/test.db"
)
require 'rubygems'
require 'dm-core'
DataMapper.setup(:default, "sqlite3:///#{File.expand_path(File.dirname(__FILE__))}/test.db")
class User
include DataMapper::Resource
property :id, Integer, :serial => true
property :name, String, :nullable => false
has n, :items
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import gdata.photos.service
gd_client = gdata.photos.service.PhotosService()
user = '<ユーザーID>'
# アルバムの情報を取得
#!/usr/bin/env ruby
require 'readline'
require 'open-uri'
Thread.new do
puts open('http://example.com/').read
end
while buf = Readline.readline("", true)