Skip to content

Instantly share code, notes, and snippets.

View rummelonp's full-sized avatar
🐈‍⬛
ニャーン

Kazuya Takeshima rummelonp

🐈‍⬛
ニャーン
View GitHub Profile
@v=('分かる','それな');
print@v[rand @v],"\n"while<STDIN>;
if grep -i SELINUX=Enforcing /etc/selinux/config > /dev/null; then
sudo sed -i s/SELINUX=Enforcing/SELINUX=Permissive/i /etc/selinux/config
fi
if [ "$(/usr/sbin/getenforce)" != 'Permissive' ]; then
sudo /usr/sbin/setenforce 0
fi
カゴカド
カゴカワ
カゴカン
カゴドド
カゴドワ
カゴドン
カゴワド
カゴワワ
カゴワン
カドカゴ
@rummelonp
rummelonp / node_install.sh
Created May 19, 2015 12:29
Linux に雑に node インストール
cd /usr/local/src
curl -O http://nodejs.org/dist/v0.12.3/node-v0.12.3-linux-x64.tar.gz > /dev/null
tar zxvf node-v0.12.3-linux-x64.tar.gz
mv node-v0.12.3-linux-x64 node
ln -s /usr/local/src/node/bin/* /usr/local/bin
@rummelonp
rummelonp / .bash_profile
Created May 14, 2015 15:27
最低限の bash の設定
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
RESET="\e[0m"
GREEN="\e[0;32m"
# Description:
# Let hubot track your co-workers' honor points
#
# Configuration:
# HUBOT_SCOREKEEPER_MENTION_PREFIX
# HUBOT_SCOREKEEPER_MENTION_SUFFIX
#
# Commands:
# <name>++ - Increment <name>'s point
# <name>-- - Decrement <name>'s point
(function(){var s=getSelection().toString();window.location='tweetbot:///post?text='+encodeURIComponent((!!s?'"'+s+'" / ':'Now Browsing: ')+document.title+' '+window.location);})();
@rummelonp
rummelonp / _cap
Created February 4, 2015 16:28
capistrano 3 用の zsh 補完関数
#compdef cap
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for Capistrano (http://capistranorb.com/).
#
# ------------------------------------------------------------------------------
# Authors
# -------
@rummelonp
rummelonp / Capfile
Created January 22, 2015 11:22
capistrano 3 でサブディレクトリをデプロイするやつ
require 'capistrano/git'
class Capistrano::Git
module SubDirectoryStrategy
include DefaultStrategy
def release
git :archive, fetch(:branch), fetch(:project_root), '| tar -x -C', release_path, "--strip=#{fetch(:project_root).count('/')+1}"
end
end
@rummelonp
rummelonp / scope_to_factory.rb
Created September 30, 2014 14:46
今あるデータから雑に FactoryGirl の定義生成するやつ
def scope_to_factory(scope)
class_name = scope.first.class.name
class_underscore_name = class_name.underscore.gsub('/', '_')
f = File.new("#{Rails.root}/spec/factories/#{class_underscore_name}.rb", 'w')
f.puts "# coding: utf-8"
f.puts "# Read about factories at https://github.com/thoughtbot/factory_girl"
f.puts ""
f.puts "FactoryGirl.define do"
f.puts " factory :#{class_underscore_name}, class: \"#{class_name}\" do"
scope.each do |record|