Skip to content

Instantly share code, notes, and snippets.

Avatar
🔥
🍖

Norio Suzuki suzuki

🔥
🍖
View GitHub Profile
View tdiary_20140202_hogeTest.php
<?php
class HogeTest extends PHPUnit_Framework_TestCase
{
public function testDummy2()
{
$this->assertTrue(true);
}
}
@suzuki
suzuki / mail1.php
Created Feb 2, 2014
Swift Mailer sample / normail email
View mail1.php
<?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 Feb 2, 2014
composer.json for Swift Mailer
View composer.json
{
"require": {
"swiftmailer/swiftmailer": "5.0.*"
}
}
View before.php
<?php
namespace Acme\HelloBundle\Tests\Service;
use \Phake;
use Acme\HelloBundle\Service\DummyService;
class DummyServiceTest extends \PHPUnit_Framework_TestCase
{
private $dummyService;
View dummy.html
<div
id="hoge"
class="fuga"
>
</div>
View sample.html.twig
<!doctype html>
<html>
<head>
<!-- (1) -->
<meta charset="UTF-8">
<style>
/* (2) */
h1 {
/* (3) */
font-weight: bold;
View test.sql
SELECT
*
FROM
table
WHERE
flag = TRUE
AND
category IN ('a', 'b')
;
View Highcharts stack column data
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]
View swap-buffers
(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)
View td-agent.conf
<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.**>
You can’t perform that action at this time.