Skip to content

Instantly share code, notes, and snippets.

View chiastolite's full-sized avatar

Hiroyuki Morita chiastolite

View GitHub Profile
cookbook_file "/etc/profile.d/proxy.sh" do
source "proxy.sh"
mode "0755"
end
@chiastolite
chiastolite / deploy.rb
Created December 7, 2012 04:46
Deploy Redmine with Capistrano
require 'bundler/capistrano'
set :application, "redmine"
set :repository, "git://github.com/redmine/redmine.git"
set :use_sudo, false
set :git_enable_submodules, true
set :default_environment, {
@chiastolite
chiastolite / Capfile
Last active October 16, 2018 02:04
Capistranoでファイルをアップロードする
load 'config/deploy'
eval('%d.upto(%d){|x|puts ("FizzBuzz "[n=x**4%%-15,n+13]||x.to_s).strip}'%$*)
guard 'rspec' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
end
# -*- coding:utf-8 -*-
require 'bundler/setup'
Bundler.require
require 'redcarpet'
class DenDen < Redcarpet::Render::HTML
def normal_text text
text.gsub(/\^([^\^]+?)\^/) do |_|
"<span class='tcy'>#{$1}</span>"
end.gsub(%r!{([^|]+)\|(.+)}!) do |_|
gem "rspec-rails", :group => "test"
generate "rspec:install"
gem "slim-rails"
gem_group :development do
gem 'pry-rails'
gem 'pry-remote'
end
source "https://rubygems.org"
gem "veewee", github: 'jedi4ever/veewee'
gem "vagrant", github: 'mitchellh/vagrant', :tag => 'v1.1.4'
@chiastolite
chiastolite / application.html.slim
Last active December 26, 2015 18:49
rails-templates
doctype 5
html
head
title = content_for?(:title) ? yield(:title) : (controller.controller_name + " : " + controller.action_name)
= stylesheet_link_tag :application
= javascript_include_tag :application
= csrf_meta_tags
/[ if lt IE 9 ]
script src="//html5shiv.googlecode.com/svn/trunk/html5.js"
body
@chiastolite
chiastolite / gist:8519728
Created January 20, 2014 13:19
Redcarptでgfmしたときの
def md(content)
gfm.render(content).html_safe
end
private
class XHTMLwithPygments < Redcarpet::Render::XHTML
def block_code(code, language)
::Pygments.highlight(code, lexer: language)
end