Skip to content

Instantly share code, notes, and snippets.

@machida
machida / variables.sass
Created May 20, 2012 13:28
variablesのsample
$basic-font-color: #444
#main article
color: $basic-font-color
font-size: 14px
line-height: 1.6
#side h2
color: $basic-font-color
font-size: 16px
@machida
machida / operations1.sass
Created May 20, 2012 14:23
The standard math operations sample
$main-width: 660px
$side-width: 300px
div#wrap
width: $main-width + $side-width
div#main
width: $main-width
div#side
@machida
machida / operations2.sass
Created May 20, 2012 14:30
The standard math operations sample2
$global-nav-width: 960px
$items: 5
nav#global
width: $global-nav-width
ul
li
display: inline
a
display: block
@machida
machida / mixin.sass
Created May 20, 2012 15:25
mixinのsample
=blue_button
text-align: center
display: block
font-family: Arial, Helvetica, sans-serif
font-size: 14px
color: #ffffff
line-height: 30px
width: 80px
background: -moz-linear-gradient(top, #5779ff 0%, #3254cf)
background: -webkit-gradient(linear, left top, left bottom, from(#5779ff), to(#3254cf))
%article
.header
.title
%h1= @entry.title
- unless @entry.category.nil?
.category
%a{:href => @entry.category.link}= @entry.category.title
%p.author
Posted by #{@entry.user.name}
.date
@machida
machida / gist:2940288
Created June 16, 2012 06:58
Add copyright notice to wordpress footer
<footer id="footer">
<p class="copyright">Copyright&copy;<a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>home"><?php bloginfo('name'); ?></a> <?php echo date('Y'); ?> All Rights Reserved.</p>
</footer>
@machida
machida / html5.haml
Created June 16, 2012 07:05 — forked from fnhipster/html5.haml
HTML5 HAML Template
!!! 5
%html
%head
%title= "Your Website"
%meta{ :content => "", :name => "description" }
%meta{ :content => "", :name => "author" }
%link{ :href => "/feed", :rel => "alternate", :title => "Atom", :type => "application/atom+xml" }
%link{ :href => "/css/screen.css", :media => "screen", :rel => "stylesheet" }
%script{:type => "text/javascript", :src => "http://code.jquery.com/jquery-1.7.min.js"}
/[if lt IE 9]
@machida
machida / gist:2940369
Created June 16, 2012 07:21
Call the articles with a specific tag use query_posts
<ul>
<?php if (have_posts()) : query_posts('&tag=wordpress&showposts=10'); ?>
<?php while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
<?php endwhile; endif; ?>
<?php wp_reset_query();?>
</ul>
@machida
machida / gist:2940554
Created June 16, 2012 08:43
Add target _blank at link to other site.
$(document).ready ->
$("a[href^=http]").not("[href*=" + location.hostname + "]").attr "target", "_blank"
@machida
machida / gist:2940660
Last active October 6, 2015 05:07
Equal to the height of the "body" the height of the "nav#global".
$ ->
$("nav#global").css "height", $("body").height()