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
<match fluent.**> | |
type record_modifier | |
tag internal.message | |
host ${hostname} | |
tag_key original_tag | |
include_tag_key | |
</match> |
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
CREATE TABLE todesking (created_at text, status int); | |
INSERT INTO todesking VALUES | |
('01-01', 0), | |
('01-02', 0), | |
('01-03', 1), | |
('01-04', 0) | |
; | |
SELECT |
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
CREATE FUNCTION eval(sql Text) RETURNS SETOF Record AS $$ | |
BEGIN | |
RETURN QUERY EXECUTE sql; | |
RETURN; | |
END; | |
$$ LANGUAGE plpgsql; | |
SELECT * FROM eval('SELECT * FROM( VALUES (1), (3) ) AS t') AS (i Int); | |
i |
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
#!/usr/bin/env ruby | |
require 'twilio-ruby' | |
require 'json' | |
require 'optparse' | |
require 'uri' | |
require 'logger' | |
module TwilioCall | |
class Conf |
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 <msgpack.h> | |
int main() | |
{ | |
msgpack_sbuffer sbuf; | |
msgpack_sbuffer_init(&sbuf); | |
msgpack_packer pk; | |
msgpack_packer_init(&pk, &sbuf, msgpack_sbuffer_write); |
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
#!/usr/bin/env ruby | |
require 'twilio-ruby' | |
require 'json' | |
require 'optparse' | |
require 'uri' | |
require 'logger' | |
module TwilioCall | |
class Conf |
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
-- 準備 | |
psql1 $ create table foo(v text); | |
psql1 $ create table bar(v text); | |
psql1 $ insert into foo values ('foo'); | |
psql1 $ insert into tmp values ('bar'); | |
-- swap: bar -> foo, foo -> bar | |
psql1 $ begin; | |
psql2 $ begin; |
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
-- 準備 | |
psql1 $ create table foo(v text); | |
psql1 $ create table tmp(v text); | |
psql1 $ insert into foo values ('foo'); | |
psql1 $ insert into tmp values ('tmp'); | |
-- rename: tmp -> foo | |
psql1 $ begin; | |
psql2 $ begin; |
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
-- バージョン | |
SELECT version(); | |
version | |
----------------------------------------------------------------------------------------------------------------------------------------------- | |
PostgreSQL 9.2.0 on x86_64-apple-darwin11.4.2, compiled by Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn), 64-bit | |
(1 row) | |
-- ランダム文字 | |
CREATE OR REPLACE FUNCTION random_char() RETURNS text AS $$ | |
SELECT chr((round((random() * 25)::numeric, 0))::int + 97); |
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
package main | |
import ( | |
"net" | |
"fmt" | |
"runtime" | |
"sync" | |
"time" | |
) |