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 / gist:4169169
Created November 29, 2012 13:41
listのn番目以降を隠したり表示したりするjQuery(gist: 4168815 をもうちょっとかっこよくした)
$(function(){
var contents = '.list li'; //対象のlist
var trigger = '.trigger'; //スイッチ
var contentsLength = $(contents).length; //listの個数
var n = 10; //初期状態で表出したいlistの個数
//listがn個以上ある場合は
if(contentsLength > n){
//n番目以降を隠す
for(var i=n; i<contentsLength; i++){
@taea
taea / hideTooManyLists.js
Last active October 13, 2015 08:38
listのn番目以降を隠したり表示したりするjQuery (gist:4169169) をCoffeeScriptにした
$ ->
contents = ".skilltags-more li" #対象のlist
trigger = ".skilltag-more-trigger" #スイッチ
contentsLength = $(contents).length #listの個数
n = 10 #初期状態で表出したいlistの個数
#listが10個以上ある場合は
if contentsLength > n
#n番目以降を隠す
@taea
taea / gist:4211670
Last active October 13, 2015 14:47
Font family collection - 気になったfont-familyを集めるスレ

Speaker Deck

font-family: 'Open Sans', "Lucida Grande", Tahoma, Verdana, sans-serif;

Sumally

font-family: Georgia,"MS 明朝","Hiragino Mincho Pro W3","ヒラギノ明朝 Pro W3",serif;

Klout

@taea
taea / zurui-mixin.css.sass
Last active October 13, 2015 23:08
zurui-mixin.sass
/* ==========================================================================
/* zurui-liner-gradient
/* --------------------------------------------------------------------------
=gradient-top-lighten($color : #666, $lighten: 10%)
background-color: $color
+filter-gradient(lighten($color, $lighten), $color,vertical)
+background-image(linear-gradient(lighten($color,$lighten) 0%, $color 100%))
=gradient-top-darken($color : #666, $darken: 10%)
background-color: $color
@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 / 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 / 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 / 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 をコピー)