Skip to content

Instantly share code, notes, and snippets.

View pyar6329's full-sized avatar

Tsukasa Arima pyar6329

View GitHub Profile
@pyar6329
pyar6329 / rails_heroku.sh
Last active August 29, 2015 13:55
rails new shellscrpit (github => travis => heroku)
RED=$'\e[0;31;1m'
COLOR_OFF=$'\e[0m'
if [ ! "$#" = "1" ]; then
echo "$RED""please input app_name!""$COLOR_OFF"
else
mkdir "$1"
cd "$1"
touch Gemfile
echo 'source "http://rubygems.org"' >> Gemfile
@pyar6329
pyar6329 / sublime_default_indent.json
Created February 6, 2014 10:24
SublimeText default indent Settings(py, js, css)
{
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"tab_size": 4,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true
}
@pyar6329
pyar6329 / sublime_default_rails.json
Created February 6, 2014 10:33
SublimeText Rails indent Settings(rb, yml, html, html.erb, sass, scss, less, coffee)
{
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true
}
@pyar6329
pyar6329 / .travis.yml
Created February 8, 2014 11:04
travis.yml
language: ruby
rvm:
- 2.1.0
script:
- bundle exec rake db:drop db:create db:migrate spec
- bundle exec rake
deploy:
provider: heroku
api_key:
secure: i10FXTWrPu76ocJyUxsJ7ukYUeL7UCGOnTL8uMuxeRSRU24L+xixIAi+CHXxv/MqXRHj8srXM18n4j80QgP1Sv2QNJg8VMCSrOAN8gMMOr9vB2+5PdkA136WvGb+YlfHcdCTfC4RtJrfjLTuXhMl6/9XIaVNrAMZ8obnHH+ca5k=
box: wercker/ubuntu12.04-ruby2.0.0
services:
- wercker/postgresql
build:
steps:
- bundle-install
- rails-database-yml:
service: postgresql
- script:
name: echo ruby information
@pyar6329
pyar6329 / mk_rails.sh
Last active August 29, 2015 13:58
mk_rails.sh
#!/bin/sh
if [ ! "$#" = "1" ]; then
echo "$RED""please input app_name!""$COLOR_OFF"
else
rails new "$1" --skip-bundle --skip-test-unit
cd "$1"
sed -i -e "/sqlite3/d" Gemfile
echo "" >> Gemfile
echo "# Use sqlite3 as the database for Active Record" >> Gemfile
echo "group :development do" >> Gemfile
@pyar6329
pyar6329 / ubuntu_setup.sh
Created April 3, 2014 20:52
ubuntu_setup.sh
#!/bin/sh
sudo apt-get install -y build-essential libreadline-dev libssl-dev zlib1g-dev libxml2-dev libxslt-dev curl git-core openssl bison libreadline6-dev libyaml-dev libsqlite3-dev sqlite3 libxslt1-dev autoconf libncurses5-dev libmysqlclient-dev libpcre3-dev python-software-properties sysv-rc-conf colordiff libgdbm-dev libffi-dev libpq-dev libmongo-client-dev
@pyar6329
pyar6329 / layout.js
Created April 11, 2014 16:05
Objectに合わせて縦にリサイズ
// objectに合わせて縦にリサイズ
function onResize(mapElem, leftElem, rightElem) {
var mapHeight = $(mapElem).height();
var arrows = {
left: $(leftElem).find('img').height(),
right: $(rightElem).find('img').height()
};
$(leftElem).find("img").css("margin-top", (mapHeight - arrows.left) / 2);
$(rightElem).find("img").css("margin-top", (mapHeight - arrows.right) / 2);
};
@pyar6329
pyar6329 / latex.sh
Last active August 29, 2015 14:02
LaTeXの日本語にヒラギノを適用する
#!/bin/sh
{
echo "LaTeX -> Hiragino"
# clear any previous sudo permission
sudo -k
# run inside sudo
sudo sh <<SCRIPT
@pyar6329
pyar6329 / .gitignore
Created August 2, 2014 22:39
.gitignore of swift language
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3