This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
require 'net/smtp' | |
require 'kconv' | |
require "open-uri" | |
require "json" | |
#メール関連の設定。 プログラムを使う人の環境に応じて適切に書き換えてください | |
from_addr = '※※※※' # 送信元のメールアドレスを設定。 | |
mailserver={} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'RMagick' | |
include Magick | |
BKCOLOR_SPLASH = '#0000FF' | |
BKCOLOR_ICON = '#0000FF' | |
def mkAppIcon(iconfile,size,bkColor='#000000') | |
canvas = Image.new(size,size){ | |
self.background_color = bkColor | |
self.format = 'png' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** 文字列の前後の空白を削除 */ | |
String.prototype.trim = function() { | |
return this.replace(/^\s+|\s+$/g, ""); | |
} | |
/** 文字列の改行を削除 */ | |
String.prototype.trim_newline = function(){ | |
return this.toString().replace(/\n/g, ''); | |
} | |
/** 最後が特定の文字で終わるようにした文字列を返す。 | |
主に、パス名が/で終わることを強制するのに使う |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
util = {} | |
//thanks to http://blog.xole.net/article.php?id=612 | |
util.TraceLog = function (){ | |
this.startTime = -1; | |
}; | |
util.TraceLog.prototype = { | |
start: function(message){ | |
this.startTime = new Date().getTime(); | |
Ti.API.debug('[' + message + '] has started'); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
require "singleton" | |
require "uri" | |
require 'lib/debugLog.rb' | |
#WEBページを取得するための基底クラス | |
class ScraperException < StandardError; end | |
class ScraperPageNotFoundException < ScraperException; end | |
class Scraper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>start application automatically and kill myself.</title> | |
<script type="text/javascript"> | |
function init(){ | |
var iframe = document.createElement('iframe'); | |
iframe.src = "sms:///"; | |
document.body.appendChild(iframe); | |
window.opener = window; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
include_once("facebook/facebook.php"); //include facebook SDK | |
function myurl(){ | |
if ( isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on' ){ | |
$protocol = 'https://'; | |
}else{ | |
$protocol = 'http://'; | |
} | |
return $protocol.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::import('Vendor', 'facebook/facebook'); | |
class FacebookController extends AppController{ | |
protected $facebook = NULL; | |
function beforeFilter(){ | |
$this->facebook = new Facebook(array( | |
'appId' => Configure::read('facebook.appid'), | |
'secret' => Configure::read('facebook.secret'), | |
)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Copyright 2013 mogya. | |
* Copyright 2011 Facebook, Inc. | |
* | |
* 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOOP = 10000000; | |
var start, end; | |
// logging | |
function log(msg){ | |
return console.log(msg); | |
} | |
function checkStrTernary(arg){ | |
start = new Date(); |