Skip to content

Instantly share code, notes, and snippets.

@kechol
kechol / deploy.coffee
Last active September 23, 2019 20:45
hubot deploy script
# Description:
# Capistrano deployment from hubot
#
# Dependencies:
# Prepare capistrano config files in your repo.
#
# Configuration:
# None
#
# Commands:
@kechol
kechol / common.coffee
Last active August 29, 2015 14:10
Utils for CasperJS Testing
# dev.rlx.jp
casper.httpAuth =
user: 'http'
password: 'auth'
# test user
casper.testUser =
email: '[email protected]'
password: 'p@ssw0rd'
@kechol
kechol / circle.yml
Created November 26, 2014 04:15
Example configuration of Circle CI
machine:
timezone:
Asia/Tokyo
hosts:
ci.example.com: 127.0.0.1
php:
version: 5.6.2
node:
version: 0.10.28
python:
@kechol
kechol / greetings.coffee
Last active August 29, 2015 14:09
挨拶スクリプト for Hubot
# Description:
# hubot scripts to greet members friendly
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
'use strict'
class NgWebsocket
@$inject: ['$window', '$location', '$rootScope']
constructor: (@$window, @$location, @$rootScope) ->
@WebSocket = @$window.WebSocket || @$window.MozWebSocket || @$window.WebkitWebSocket
@client = null
@queue =
data : []
@kechol
kechol / nl2br.coffee
Created October 8, 2014 01:24
line break filter
'use strict'
angular.module('chatcenter.filters')
.filter 'nl2br', () ->
(input) ->
(input+'').replace(/(:?\r\n|\n\r|\r|\n|&#10;)/g, '<br>')
@kechol
kechol / json2md.rb
Last active August 29, 2015 14:07
json to markdown table
#!/usr/bin/env ruby
require 'json'
json = JSON.parse(STDIN.read)
tr = []
tds = []
fetch = lambda { |o|
tr = o.keys
@kechol
kechol / deploy.rb
Created October 6, 2014 17:27
add rake db:* tasks to capistrano 3
namespace :db do
%w[create migrate reset rollback seed setup].each do |command|
desc "Rake db:#{command}"
task command.to_sym do
on roles(:app), in: :sequence, wait: 5 do
within current_path do
with :rails_env => fetch(:rails_env) do
execute :rake, "db:#{command}"
end
end
@kechol
kechol / b2g_playbook.yml
Created July 21, 2014 06:50
ansible playbook for b2g on Ubuntu 12.04 LTS
---
- hosts: b2g
remote_user: ubuntu
sudo: yes
vars:
- ccache_size: 3GB
- git_user: b2g
- git_email: [email protected]
- b2g_repo: git://github.com/mozilla-b2g/B2G.git
@kechol
kechol / vspace.less
Created July 20, 2014 08:07
css helper class to make vertical spaces. it works fine with bootstrap.
.vspace(50);
.vspace(@n, @i: 5) when (@i =< @n) {
.vspace-@{i} {
margin-top: @i * 1px;
margin-bottom: @i * 1px;
}
.vspace-tp-@{i} {
margin-top: @i * 1px;
}