Skip to content

Instantly share code, notes, and snippets.

-- select
-- A.asmst_id,
-- B.email, B.entry_group_cd,
-- C.website_name
select count(*)
from (
select
a.asmst_id
from (
git diff --cached
git log -p
git log --oneline --graph
git log --after=2013-08-14 --author="t_shinozaki"
git commit --amend
git blame -s
git rebase -i HEAD~
http://www.backlog.jp/git-guide/stepup/stepup1_1.html
@gkojax
gkojax / a.scala
Last active December 17, 2015 19:28
社内勉強会でusingについて説明
// 単純なopen、close
val fileName = "text.txt"
val resource = new BufferedReader(new FileReader(new File(fileName)))
resource.readLine
resource.close
@gkojax
gkojax / exe.scala
Created April 24, 2013 16:41
0 secondsとか1 minutesみたいなの書きたい。
import play.api._
import play.api.libs.concurrent.Akka
import akka.actor._
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.language.postfixOps
actorSystem.scheduler.schedule(0 seconds, 1 minutes, ...
@gkojax
gkojax / aaa.scala
Created April 23, 2013 11:56
普通にこれでplay updateできるんだけどなあ
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "aaa"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
@gkojax
gkojax / aaa.scala
Created April 10, 2013 08:30
64文字の文字列を8文字ずつに区切ってリスト化する
//
// 64文字の文字列を8文字ずつに区切ってリスト化する
//
// 1234567890123456789012345678901234567890123456789012345678901234
// -> List(12345678, 90123456, 78901234, 56789012, 34567890, ....)
//
def aaa(s: String, l: Int): List[String] = {
def bbb(s: String, e: List[String]): Pair[String, List[String]] = s match {
case s if s.length < l =>
(s, e :+ s)
require 'logger'
class MyFormatter < Logger::Formatter
def call(severity, timestamp, progname, msg)
if String === msg then
if msg.nil? or msg.empty? then
return "\n"
else
return "%s %s\n" % [timestamp.strftime("%H:%M:%S"), msg]
end
<source>
type tail_ex
path /log_dir/postlog/%Y/%m/%d.txt
tag posts
format /^(?<user>.*)\t(?<postid>.*)\t(?<date>.*)\t(?<rk>.*)\t(?<offset>.*)\t(?<count>.*)$/
pos_file /var/tmp/fluentd_quote.pos
refresh_interval 1800
</source>
# <match debug.**>
@gkojax
gkojax / gist:4678404
Created January 30, 2013 23:32
tumblr apiを使って、queueに入ってるpostをpublishする。
path = 'http://api.tumblr.com/v2/blog/%s.tumblr.com/post/edit' % [user]
header = {
'reblog_key'=> reblog_key,
'id' => postid,
'state' => 'published'
}
response = @access_token.post(path, header)