Skip to content

Instantly share code, notes, and snippets.

@yandod
yandod / action_mailer.php
Created May 28, 2011 18:48
ActionMailer - A reusable email class for CakePHP
<?php
/**
* Created: Sat Aug 05 02:19:40 EDT 2006
*
* A base class for application wide E-Mail sending/logic inspired
* by the Ruby on Rails ActionMailer.
*
* The Actionmailer is a hybrid of a Model and Controller since it
* renders it's own views to be send out via mail. The easiest way to
@yandod
yandod / myfckconfig.js
Created June 15, 2011 19:13
Specify caption for font size dropdown of FCKEditor
// "/" is delimiter for style/caption
FCKConfig.FontSizes = 'small/小;medium/中;large/大' ;
repo for a more modern version of qt (4.7)
http://atrpms.net/documentation/install/
http://packages.atrpms.net/dist/el5/qt4/
cat /etc/yum.repos.d/atrpms.repo
[atrpms]
name=ATrpms manual
baseurl=http://dl.atrpms.net/el5-$basearch/atrpms/testing/
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
@yandod
yandod / tap2junit.rb
Created June 17, 2011 21:21
TAP (Test Anything Protocal) format test result to Jenkins readable xml.
#!/usr/bin/ruby
require 'rexml/document'
xml = REXML::Document.new
xml << REXML::XMLDecl.new('1.0', 'UTF-8')
testsuites = xml.add_element("testsuites")
#initialize vars
@yandod
yandod / log.txt
Created June 18, 2011 20:55
What was wrong ?
[yandod@localhost workspace]$ cakerunner --cakephp-app-path /home/yandod/github/candycane/app --log-junit=log.xml -R /home/yandod/github/candycane/app/tests/cases/
ERROR: option --log-junit is ambiguous
pear info piece/stagehand_testrunner
> About pear.piece-framework.com/Stagehand_TestRunner-2.16.0
@yandod
yandod / gloc2gettext.rb
Created June 19, 2011 19:20
redmine i18n file transformer (Gloc to getText)
#!/usr/bin/ruby
master_file = "./redmine-0.8.1/lang/en.yml"
local_file = "./redmine-0.8.1/lang/ru.yml"
class Gloc2gettext
def Gloc2gettext.parse(fname)
tmpmap = Hash.new
File.open(fname){|f|
i = 0;
@yandod
yandod / entries.json
Created January 2, 2012 12:34
plugin list for candycane
{
"cc_nyancat":{
"id":"cc_nyancat",
"name":"Nyan Down Chart",
"description":"This plugin make you nyan'd!!",
"url":"https:\/\/github.com\/downloads\/yandod\/cc_nyancat\/cc_nyancat-v0.2.zip",
"author":"yandod",
"author_url":"https:\/\/github.com\/yandod",
"version":"0.1"
},
@yandod
yandod / sample.php
Created January 24, 2012 14:33
PDOとmod_rewriteの動作状況確認スクリプト (CakePHP2にはPDOが必要です。mod_rewriteはあった方が良い。)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<?php
//DBの接続情報
$user = 'root';
$pass = 'pass';
@yandod
yandod / plain.php
Created February 5, 2012 00:20
普通のPHPスクリプト
<?php
$keyword = '';
if (isset($_POST['keyword'])) {
$keyword = $_POST['keyword'];
}
mysql_connect('localhost','user','password');
mysql_select_db('cakephp_sample');
mysql_query('set names utf8');
$sql = sprintf(
@yandod
yandod / sample.sql
Created February 5, 2012 05:14
sample data
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE IF NOT EXISTS `categories` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` tinytext COLLATE utf8_unicode_ci NOT NULL,
`created` datetime NOT NULL,
`modified` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ;