Skip to content

Instantly share code, notes, and snippets.

<source>
type tail
format /^(?<ip>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] (?<server>\S+) "(?<method>\S+)(?: +(?<path>[^ ]*) +\S*)?" (?<status>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<user_agent>[^\"]*)")?$/
time_format %d/%b/%Y:%H:%M:%S %z
path /var/log/tdiary_access.log
pos_file /var/log/td-agent/tdiary_access.log.pos
tag tdiary.access
</source>
<match tdiary.access>
#!/bin/sh
HOME="/home/suzuki"
WORK="$HOME/work"
GTAGS="/usr/bin/gtags"
TARGETS="$WORK/project-a
$WORK/project-b
$WORK/project-c
"
@suzuki
suzuki / Cask
Last active August 29, 2015 14:08
My Cask file.
(source gnu)
(source melpa)
(depends-on "auto-complete")
(depends-on "auto-complete-rst")
(depends-on "auto-install")
(depends-on "coffee-mode")
(depends-on "color-moccur")
(depends-on "dash-at-point")
(depends-on "editorconfig")
<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.**>
(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)
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]
SELECT
*
FROM
table
WHERE
flag = TRUE
AND
category IN ('a', 'b')
;
<!doctype html>
<html>
<head>
<!-- (1) -->
<meta charset="UTF-8">
<style>
/* (2) */
h1 {
/* (3) */
font-weight: bold;
<div
id="hoge"
class="fuga"
>
</div>
<?php
namespace Acme\HelloBundle\Tests\Service;
use \Phake;
use Acme\HelloBundle\Service\DummyService;
class DummyServiceTest extends \PHPUnit_Framework_TestCase
{
private $dummyService;