Skip to content

Instantly share code, notes, and snippets.

@jmblog
jmblog / new-clearfix.css
Created December 13, 2009 01:23
new clearfix
/* new clearfix */
/* http://perishablepress.com/press/2009/12/06/new-clearfix-hack/ */
.clearfix:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
@jmblog
jmblog / gist:255328
Created December 13, 2009 07:16
モダンなファイル入出力
### file read ###
open my $fh, '<', $filename || die $@;
while (my $line = <$fh>) {
print $line;
}
close $fh;
### file write ###
use utf8;
@jmblog
jmblog / gist:255912
Created December 14, 2009 08:50
超シンプルなCoroのサンプル
use Coro;
### To create a thread, use the async function
async {
print "async 1\n";
cede;
print "async 2\n";
};
print "main 1\n";
@jmblog
jmblog / gist:257725
Created December 16, 2009 10:05
ヒアドキュメント
### ヒアドキュメント(変数展開なし) ###
my $text1 = <<'EOS';
aaa
bbb
ccc
EOS
### ヒアドキュメント(変数展開あり) ###
my $eee = 'eee;
my $text2 = <<"EOS"
@jmblog
jmblog / yui-fonts.scss
Created April 24, 2011 09:19
yui-fonts.scss
/* YUI Fonts.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
*/
body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}select,input,button,textarea{font:99% arial,helvetica,clean,sans-serif;}table{font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}
@mixin font_10 { font-size: 77%; }
@jmblog
jmblog / 1kb_grid.scss
Created May 10, 2011 02:34
1kb_grid.scss
/*
1kb_grid.scss
This SCSS is based on "The 1Kb CSS Grid".
Learn more ~ http://www.1kbgrid.com/
*/
/* Grid Settings
---------------------------*/
$columns: 12; // Number of columns (9, 10, 12, 14 or 16)
@jmblog
jmblog / 1kb_grid_extended.scss
Created May 10, 2011 04:52
1kb_grid_extended.scss
/*
1kb_grid_extended.scss
This SCSS is based on "The 1Kb CSS Grid".
Learn more ~ http://www.1kbgrid.com/
*/
/* Grid Settings
---------------------------*/
$columns: 12; // Number of columns (9, 10, 12, 14 or 16)
@jmblog
jmblog / adjust-font-size.scss
Created May 12, 2011 01:21
adjust-font-size.scss
@function -yui-font-size($px) {
@if $px == 10 { @return 77%; }
@else if $px == 11 { @return 85%; }
@else if $px == 12 { @return 93%; }
@else if $px == 13 { @return 100%; }
@else if $px == 14 { @return 108%; }
@else if $px == 15 { @return 116%; }
@else if $px == 16 { @return 123.1%; }
@else if $px == 17 { @return 131%; }
@else if $px == 18 { @return 138.5%; }
@jmblog
jmblog / 960gs.scss
Created May 18, 2011 06:57
960gs.scss
/*-----------------------------------------------------
960 Grid System ~ Core CSS.
Learn more ~ http://960.gs/
Licensed under GPL and MIT.
-------------------------------------------------------*/
/* Grid Settings
---------------------------*/
// 12-column grid
@jmblog
jmblog / linear-gradient.scss
Created August 12, 2011 05:10
linear-gradient.scss
$css3-ie-support: 0 !default;
@mixin linear-gradient($topColor, $bottomColor) {
background-image: -moz-linear-gradient(top, $topColor, $bottomColor);
background-image: -webkit-gradient(linear, left top, left bottom, from($topColor), to($bottomColor));
// If you set the output style as "compressed", it doesn't work well...
@if $css3-ie-support == 1 {
$ieTopColor: rgb(red($topColor), green($topColor), blue($topColor));
$ieBottomColor: rgb(red($bottomColor), green($bottomColor), blue($bottomColor));