Skip to content

Instantly share code, notes, and snippets.

@vexus2
vexus2 / send_pr_count_to_chatwork.rb
Last active August 29, 2015 13:56
特定リポジトリにたまっているPull Request数をChatWorkに通知
#!/usr/bin/env ruby
#-*- encoding: utf-8 -*-
require 'json'
require 'pit'
require 'time'
require 'net/https'
require 'octokit'
## get config from pit
@vexus2
vexus2 / .pryrc
Created April 8, 2014 07:13
.pryrc
begin
require "awesome_print"
AwesomePrint.pry!
rescue LoadError => err
puts "no awesome_print :("
end
# hirbの設定
begin
require 'hirb'
@vexus2
vexus2 / gist:3f2d7eb8fd9b59b383d5
Created May 9, 2014 04:23
Update local ruby to 2.1.2
$ sudo brew update
$ sudo brew upgrade ruby-build
$ rbenv install 2.1.2
$ rbenv global 2.1.2
$ rbenv rehash
$ ruby --version
@vexus2
vexus2 / private.xml
Created August 8, 2014 01:38
Ctrl+P→手前のUnreadチャンネル、Ctrl+N→次のUnreadチャンネルに移動
<?xml version="1.0"?>
<root>
<appdef>
<appname>SLACK</appname>
<equal>com.tinyspeck.slackmacgap</equal>
</appdef>
<item>
<name>For Slack CTRL+N=move previous unread hannel, CTRL+P=move unread next channel</name>
<identifier>private.app_slack_move_channel_with_altn_altp</identifier>
<only>SLACK</only>
@vexus2
vexus2 / gist:7c36c33c206f96dd4bfd
Last active August 29, 2015 14:07
リモートワーク_マイクを選ぶときの観点
@vexus2
vexus2 / bot2bot.coffee
Created April 20, 2015 08:41
Slack内で外部Bot/API経由の特定の発言を受け取って別のアクションを実行するスクリプト
# Description:
# 外部Bot/API経由の特定の発言を受け取って別のアクションを実行する
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
@vexus2
vexus2 / login_step.php
Created October 5, 2012 02:43
[PHP]UserAgent切り替え for Behat
<?php
/**
* @var $world FeatureContext
*/
$steps->Given( '/^"([^"]*)" でアクセスしている$/', function ( $world, $table ) {
switch ( $table ) {
case "フィーチャフォン":
$user_agent = "KDDI-CA39 UP.Browser/6.2.0.13.1.5 (GUI) MMP/2.0";
break;
case "スマートフォン":
@vexus2
vexus2 / nico_video_fetcher.rb
Created October 10, 2012 02:28
[Ruby]ニコニコ動画検索APIを実行し動画情報を取り出す
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
if RUBY_VERSION < '1.9'
require 'rubygems'
end
require File.expand_path('../../config/boot', __FILE__)
require 'json'
require 'mechanize'
require 'cgi'
@vexus2
vexus2 / common_formatter.php
Created October 11, 2012 01:34
[PHP]ISO8601形式日付などのフォーマットを行う汎用クラス
<?php
/**
* フォーマット変換ユーティリティクラス
*/
class CommonFormatter
{
/**
* 日付のフォーマット配列
*/
private static $DATE_FORMAT_ARRAY = array(
@vexus2
vexus2 / prepare.php
Created October 11, 2012 01:37
[PHP]ZendFramework用prepare設定 Zend日付バグの対応含む
<?php
if (defined('E_DEPRECATED')) {
error_reporting(E_ALL & ~E_DEPRECATED & ~E_WARNING);
} else {
error_reporting(E_ALL);
}
defined('APPLICATION_CONFIG')
|| define('APPLICATION_CONFIG', 'application.ini');