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 / breadcrumbs_microdata.haml
Last active October 12, 2015 07:38
Haml + breadcrumbs + microdata
%nav.breadcrumbs
%div{:itemscope => true, :itemtype => 'http://data-vocabulary.org/Breadcrumb'}
=link_to root_path, :itemprop => 'url' do
%span{:itemprop => 'title'}<>
HOME
%div{:itemscope => true, :itemtype => 'http://data-vocabulary.org/Breadcrumb'}
=link_to hoge_path, :itemprop => 'url' do
%span{:itemprop => 'title'}<>
hoge
@taea
taea / gist:4037440
Created November 8, 2012 07:50
Haml + Hatena Bookmark Button
=link_to image_tag('http://b.st-hatena.com/images/entry-button/button-only.gif'), 'http://b.hatena.ne.jp/entry/http://hoge.com', :class => 'hatena-bookmark-button', :data => {:hatena_bookmark_title => 'ページタイトル', :hatena_bookmark_layout => 'standard-balloon'}, :title => 'このエントリーをはてなブックマークに追加'
%script{:type => "text/javascript", :src => "http://b.st-hatena.com/js/bookmark_button.js", :charset => "utf-8", :async => "async"}
@taea
taea / balloon_mixin.sass
Last active October 12, 2016 06:58
balloon mixin : 1行でふきだしの三角部分が書けるmixin
/* balloon
=balloon-left($size: 6px, $color: #FFF, $top: 6px)
position: relative
&:after
position: absolute
content: ""
display: block
border: $size solid transparent
border-right: $size solid $color
top: $top
@taea
taea / gist:4085925
Last active October 12, 2015 20:58
Railsをpullして動かなかった場合はGitのlogを見よ

これを見る

[crowly]$ g pull
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 2 (delta 1), reused 2 (delta 1)
Unpacking objects: 100% (2/2), done.
From https://github.com/xxxx/xxxxxxx
   915a6f4..f361dce  master     -> origin/master  //←ここの数字を $ git log 915a6f4..f361dce みたいにして見る
Updating 7b18103..f361dce
@taea
taea / gist:4168815
Created November 29, 2012 12:41
listの途中まで隠しておくjQuery(ださい)
:javascript
$(function(){
var contents = '.list li.hide';
var trigger = '.trigger';
$(contents).hide();
$(trigger).click(function(){
if($(contents + ':first').is(":hidden")){
$(contents).fadeIn("fast");
$(trigger).html([
'<a href="#">',
@taea
taea / gist:4168847
Created November 29, 2012 12:48
Commitのとりけし(rebase -i)#いまのなし

###commitをこっそり取り消す (rebase -i) #いまのなし

$ git rebase -i HEAD~~~


HEADから3つのCommitがviで出てくる

消したいcommitの名前を削除

@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