Skip to content

Instantly share code, notes, and snippets.

<?php
class HogeTest extends PHPUnit_Framework_TestCase
{
public function testDummy2()
{
$this->assertTrue(true);
}
}
@suzuki
suzuki / mail1.php
Created February 2, 2014 23:50
Swift Mailer sample / normail email
<?php
require 'vendor/autoload.php';
$transport = Swift_SmtpTransport::newInstance('localhost', 25);
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance();
$message
->setFrom(['suzuki@example.com'])
@suzuki
suzuki / composer.json
Created February 2, 2014 23:56
composer.json for Swift Mailer
{
"require": {
"swiftmailer/swiftmailer": "5.0.*"
}
}
<?php
namespace Acme\HelloBundle\Tests\Service;
use \Phake;
use Acme\HelloBundle\Service\DummyService;
class DummyServiceTest extends \PHPUnit_Framework_TestCase
{
private $dummyService;
<div
id="hoge"
class="fuga"
>
</div>
<!doctype html>
<html>
<head>
<!-- (1) -->
<meta charset="UTF-8">
<style>
/* (2) */
h1 {
/* (3) */
font-weight: bold;
SELECT
*
FROM
table
WHERE
flag = TRUE
AND
category IN ('a', 'b')
;
series: [
{
name: 'name1',
stack: 'aaa',
data: [
[Date.parse('2014-06-30'), 5],
[Date.parse('2014-07-01'), 3],
[Date.parse('2014-07-02'), 4],
[Date.parse('2014-07-03'), 7],
[Date.parse('2014-07-04'), 2]
(defun swap-buffers ()
"Swapping buffers in two windows"
(interactive)
(let ((current-w (frame-selected-window))
(current-b (window-buffer (frame-selected-window)))
(other-w (get-lru-window))
(other-b (window-buffer (get-lru-window))))
(if (not (one-window-p))
(progn
(select-window current-w)
<source>
type tail
format /^(?<ip>[0-9\\.]+) \\S+ \\S+ \\[(?<time>[^\\]]+)\\] (?<server>\\S+) "(?<method>\\S+) (?<request_uri>\\S+) (?<http>\\S+)" (?<status>\\d+) (?<bytes>\\S+) \\S+ "(?<user_agent>[^\\"]+)"/
time_format %d/%b/%Y:%T %z
path /var/log/tdiary_access.log
pos_file /var/log/td-agent/tdiary_access.log.pos
tag tdiary.access
</source>
<match tdiary.**>