Skip to content

Instantly share code, notes, and snippets.

View taea's full-sized avatar
🏠
Working from home

ken_c_lo / TAEKO AKATSUKA taea

🏠
Working from home
View GitHub Profile
@taea
taea / sample.scss
Created December 19, 2012 17:47
sample.scss
@mixin line-bottom($op1: .2, $op2: .3){
border-bottom: 1px solid rgba(0, 0, 0, $op1);
@include box-shadow(rgba(255, 255, 255, $op2)0 1px 0);
}
#main {
color: #666;
font-size: 0.3em;
@include line-bottom(.3, .1);
a {
@taea
taea / sample.sass
Created December 19, 2012 17:48
sample.sass
=line-bottom($op1: .2, $op2: .3)
border-bottom: 1px solid rgba(0, 0, 0, $op1)
+box-shadow(rgba(255, 255, 255, $op2)0 1px 0)
#main
color: #666
font-size: 0.3em
+line-bottom(.3, .1)
a
font:
@taea
taea / overlay.haml
Last active December 10, 2015 04:58
overlay.js
#overlay-content-wrapper
#overlay-layer
#overlay-content
%section.contens
$ ->
$.fn.crop = (w, h) ->
$(this).on "load", ->
iw = ($(this).width() - w) / 2
ih = ($(this).height() - h) / 2
$(this).css "top", "-" + ih + "px"
$(this).css "left", "-" + iw + "px"
@taea
taea / gist:4680662
Last active December 11, 2015 23:59
ImageMagick が新しくなったせいで RMagick が動かない問題
brew unlink imagemagick
cd /usr/local/Cellar
cd imagemagick
rm -rf [新しいバージョン]
brew versions imagemagick -> バージョン一覧見る
git checkout [戻したいバージョンを指定]
brew link imagemagick
gem install rmagick
@taea
taea / git-rebase-i-HEAD.md
Last active August 25, 2021 15:33
n個前のcommitやり直し(git rebase -i)

例えば3つ前のcommitをやり直したいとき

git rebase -i HEAD~~~

または

git rebase -i HEAD~3

(~~~の数だけHEADから遡れる)

@taea
taea / cherry-pick-for-sass.md
Last active December 12, 2015 11:59
git-cherry-pickでmasterのSassを最新に

git-cherry-pick で master のSassを最新に

トピックブランチでデザイン作業後、masterにマージされるまでの間、masterのSassが最新のものから乖離してしまって作業が進められない問題を解決するために、git-cherry-pickで必要なSassの変更のみをmasterに取り込む

※この際、Sassだけcommitを分けると楽 → 不要なファイルやコンフリクトがなければそのままcommitごとmasterに取り込まれるので超ベンリです。

手順

作業中のトピックブランチで git log して必要なcommitのIDをコピー

$ git log

commit一覧が出てくるので、masterに取り込みたい「commit」の右側の文字列をコピー(下記の場合は 88ca4f2b3958748baf9947dcf1fdaebc01616cf6 をコピー)

@taea
taea / git-pull-rebase.md
Last active December 13, 2015 18:58
git pull --rebaseしなきゃいけないのに間違えて普通のpullしてしまってコンフリクトした
$ git reflog

どこまで戻ればいいのか確認

9001e69 HEAD@{0}:  pull: Fast-forward
e163cdc HEAD@{1}: commit: work in progress
cc4f489 HEAD@{2}: commit: Fix design for footer
e60b062 HEAD@{3}: rebase finished: returning to refs/heads/master
@taea
taea / autoScrollList.coffee
Last active December 13, 2015 23:59
listが一定間隔でスクロールしてくるくる回るやつ
$ ->
targetUl = "ul#autoScroll"
targetList = "ul#autoScroll li"
targetListHeight = $(targetList).height()
delayTime = 4000
scrollDistance = (-1 * targetListHeight) + 'px'
setInterval (->
$(targetUl).find("li:first").appendTo(targetUl).show()
$(targetUl).find("li:first").hide ->
@taea
taea / gist:5002402
Last active December 14, 2015 00:59
hogeコントローラーの中で定義されてるroutingを一覧する
$ rake routes CONTROLLER=hoges