Skip to content

Instantly share code, notes, and snippets.

@app2641
app2641 / pre-commit
Created Feb 21, 2017
.git/hooks/pre-commit
View pre-commit
#! /bin/sh
git df --cached --name-only --diff-filter=AM | grep '\.rb$' | grep -v 'db/schema.rb' | xargs bundle exec rubocop -c .rubocop.yml
RUBOCOP=$?
git df --cached --name-only --diff-filter=AM | grep '\.js$' | xargs npm run lint
ESLINT=$?
if [ $RUBOCOP -eq $ESLINT ]; then
exit 0
else
View prompt.sh
# prompt
export ZSH_THEME_GIT_PROMPT_DIRTY="%{%}% ✗"
export ZSH_THEME_GIT_PROMPT_CLEAN=""
function parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/'
}
DEFAULT=$'\U1F430 '
ERROR=$'\U1F363 '
export PS1="%{%}
View yochiyochi.rb.md

名前

@app2641
小林 傑 (kobayashi suguru)

職業

ウェブプログラマ

なんでRuby?

Rubyの会社に転職して使うことになったので勉強するために。

@app2641
app2641 / gist:4396017c3df8c5943610
Created May 16, 2015
Post GitHub trends to Chatwork
View gist:4396017c3df8c5943610
/**
* @var int
*/
var MAX_REPOS = 4;
/**
* @return void
*/
function postToChatworkGitHubTrends () {
View PullRequestTemplate.md

関連URL

  • WikiのURL(Markdown形式)や ...
  • 画像URL や ...
  • 操作可能な画面のURLや ...
  • (あれば...) ...

概要

@app2641
app2641 / MyReadMeTemplate.md
Last active Aug 29, 2015
MyReadMeTemplate.md
View MyReadMeTemplate.md

ToolName Build Status Coverage Status

Overview

Description

Demo

Requirement

@app2641
app2641 / Registry.php
Last active Aug 29, 2015
Zend_Regisry もどきのクラス
View Registry.php
<?php
class Registry extends \ArrayObject
{
/**
* @var Registry
**/
private static $instance;
@app2641
app2641 / gist:7939572
Last active Dec 31, 2015
ChatWorkAPI GoogleAppsScript Sample
View gist:7939572
function getCalendarSchedule () {
var calendar = CalendarApp.getCalendarsByName('予定')[0],
events = calendar.getEventsForDay(new Date()),
schedule = '';
for (var i = 0; i < events.length; i++) {
schedule += events[i].getTitle() + '\n';
}
return schedule;