Skip to content

Instantly share code, notes, and snippets.

View ykhs's full-sized avatar

Yukihisa Yamada ykhs

  • Autify, Inc.
  • Tokyo, Japan
View GitHub Profile
--- a/autoload/zencoding.vim
+++ b/autoload/zencoding.vim
@@ -456,7 +456,11 @@ function! s:zen_toString_html(settings, current, type, inline, filters, itemno,
else
if inline == 0
if stridx(','.settings.html.empty_elements.',', ','.current.name.',') != -1
- let str .= " />\n"
+ if &ft != 'xhtml'
+ let str .= ">\n"
+ else
@ykhs
ykhs / _clearfix.scss
Created April 10, 2011 14:22
個人サイトに Sass を導入してみた
@mixin clearfix {
clear: both;
zoom: 1;
&:after {
content: ".";
display: block;
height: 0;
clear: both;
@ykhs
ykhs / site.css
Created April 10, 2011 14:23
個人サイトに Sass を導入してみた(CSS 生成後)
/*!
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 3.3.0
build: 3167
*/
html {
color: #000;
background: #FFF; }
@ykhs
ykhs / _grid.scss
Created April 18, 2011 15:01
960 Grid System Using Sass.
/*!
Variable Grid System.
Learn more ~ http://www.spry-soft.com/grids/
Based on 960 Grid System - http://960.gs/
Licensed under GPL and MIT.
*/
// Containers
//----------------------------------------------------------------------------------------------------
@ykhs
ykhs / rebaseall.bat
Created April 21, 2011 06:55
Cygwin + git-svn で良く出てくる fatal error の対処
cd /d C:\cygwin\bin
ash rebaseall -v
pause
(function ($) {
$(function () {
// jQuery の要素集合をキャッシュ
var $slider_root = $('#slider'),
$slider_ul = $slider_root.find('ul'),
$slider_li = $slider_ul.find('li'),
sliderWidth = $slider_li.outerWidth(true) * $slider_li.size(),
viewWidth = 800;
@ykhs
ykhs / gist:1048792
Created June 27, 2011 12:49
オレオレ addEvent
function addEvent(element, type, handler, data, context) {
if (!element) { return false; }
if (!handler) { return false; }
context = context || element;
var fn = function (e) {
e = e || win.event;
var collection = Backbone.Collection.extend({
originalSync: Backbone.sync,
sync: function(method, model, options) {
var originalSuccess, cache;
if (method !== 'read') {
this.originalSync(method, model, options);
@ykhs
ykhs / flattenHeights.js
Created May 23, 2012 02:54
要素の高さ揃えたい
function flattenHeight(elements) {
var maxHeight, i, l, defaultView;
maxHeight = 0;
i = 0;
l = elements.length;
defaultView = document.defaultView || {};
if (defaultView.getComputedStyle) {
@ykhs
ykhs / gist:2949050
Created June 18, 2012 15:53
100数える
Array.apply(null, Array(100)).forEach(function(x, i) {
console.log(i + 1);
});