Skip to content

Instantly share code, notes, and snippets.

@pjc0247
Last active January 3, 2018 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pjc0247/d30d3ce1842f099fe32b588869055dbc to your computer and use it in GitHub Desktop.
Save pjc0247/d30d3ce1842f099fe32b588869055dbc to your computer and use it in GitHub Desktop.

[CI] 새 PR이 올라오면 답글 달고, 빌드하기

C.EventSource<NewPullRequest>("pjc0247", "Rinity")
    .Task<WriteIssueComment>()
        .In<ConstantTemplate>(WriteIssueComment.IN_Message,
            "Thank you for your contribution. We'll review your PR and reply soon.")
    .Task<CakeBuild>("src")
    .Task<SetPullRequestStatus>();

[IoT] Blink the light if there's new comment in Github

using Chain.Hue;

C.EventSource<NewIssueComment>("pjc0247", "Rinity")
    .Filter<MessageContains>("@pjc0247")
    .Task<TurnOnLight>()
    .Task<Delay>(1000)
    .Task<TurnOffLight();

[HTTP] Simple REST API Server

using Chain.HttpServ;

C.EventSource<HttpServer>(8080)
    .Filter<PostRequest>()
    .Task<MapUri>("issue/{issue_no}/comment")
    .Task<MapBody>("body")
    .Task<WriteIssueComment>("pjc0247", "Rinity")
        .In(WriteIssueComment.IN_IssueNo, "issue_no")
        .In(WriteIssueComment.IN_Message, "body"); 

[Daemon] CPU Monitor

C.EventSource<Chain.SystemMonitor.CpuUsage>()
    .Filter<Chain.SystemMonitor.CpuUsageInfo>(x => x.Value >= 30)
    .Task<SendMail>()  
        .Set(SendMail.IN_Receiver, "pjc0247@naver.com")
        .Set(SendMail.IN_Subject, "CPU usage alert")
        .Set(SendMail.IN_Body, "CPU usage over 30%");

Integrated services

  • AWS.S3
  • Gmail
  • Hue
  • Github / Git
  • PushBullet
  • Slack
  • Redis

Not yet (possiblities)

  • IoT
  • FileSystem
  • PubNub
  • Heroku
  • KakaoTalk
  • Line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment