Skip to content

Instantly share code, notes, and snippets.

@blue: #276373;
@dark_blue: #1c4c52;
@dark_gray: #636363;
@gray: #cdcece;
@red: #911400;
body {
background: @gray;
font-size: 12px;
font-family: Helvetica, Verdana, 'LiHei Pro', 新細明體, sans-serif;
/* Reset CSS v1.0 | 20080212 */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; outline: 0; font-size: 100%; } body { line-height: 1; } ol, ul { list-style: none; } blockquote, q { quotes: none; } blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; } ins { text-decoration: none; } del { text-decoration: line-through; } table { border-collapse: collapse; border-spacing: 0; }
/* self clear */
.group { clear: both; }
.group:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
/* hack ie7 */
*:first-child+html .group { min-height: 1px; background: red; }
/* hack ie6 */
* html .group { height: 1%; background: green; }
$(this).removeClass(function(index, cls) {
var classes = cls.split(' ');
var result = new Array();
$.each(classes, function(index, value) {
if(value.substring(0, 3) == 'col') {
result.push(value);
saveCol = saveCol + value;
}
});
return result.join(' ');
@maylogger
maylogger / self-clear.scss
Created March 16, 2011 17:20
用 scss 寫出一個 ie 也沒問題的 self-clear
@mixin self-clear {
clear: both;
&:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
*:first-child+html & { min-height: 1px; } // hack ie7
@maylogger
maylogger / grid.scss
Created March 16, 2011 17:45
示範如何用 scss 的 mixin 寫出一個可任意輸入數值的 grid system
@mixin grid($columns,$col-width,$gutter) {
width: ($col-width * $columns) + ($gutter * $columns);
.column {
margin: 0 $gutter $gutter 0;
float: left;
}
@for $i from 1 through $columns {
.col#{$i} {
width: ($col-width * $i) + ($gutter * ($i - 1));
}
sudo brew update
sudo brew install jruby # latest version is 1.6 (03/24/2010)
sudo gems update --system
sudo gems uninstall rawr # rawr should install via jruby
sudo jruby -S gems install rawr
# at root directory of CompassApp
sudo jruby -S rake rawr:bundle:app
# build location is package/osx/compass.app
@maylogger
maylogger / Start appleScript
Created March 28, 2011 16:09
取代登入項目 提昇開機效能
set volume 1
say "Desktop Clear" using "Vicki"
tell application "Camouflage" to launch
delay 1
say "Battery" using "Vicki"
tell application "Watts" to launch
delay 1
@maylogger
maylogger / compass!
Created July 27, 2011 05:25
compass document bookmarklet
javascript:if(w=prompt('Search%20compass-style.org:','')){top.location.href='http://google.com/search?q=site%3Acompass-style.org+'+w;}
undefined method `to_tree' for nil:NilClass
/Applications/compass.app/Contents/Resources/ruby/compass_0.11/sass-3.1.4/lib/sass/plugin/staleness_checker.rb:169:in `tree'
/Applications/compass.app/Contents/Resources/ruby/compass_0.11/sass-3.1.4/lib/sass/plugin/staleness_checker.rb:159:in `compute_dependencies'
/Applications/compass.app/Contents/Resources/ruby/compass_0.11/sass-3.1.4/lib/sass/plugin/staleness_checker.rb:142:in `dependencies'
/Applications/compass.app/Contents/Resources/ruby/compass_0.11/sass-3.1.4/lib/sass/plugin/staleness_checker.rb:119:in `dependencies_stale?'
/Applications/compass.app/Contents/Resources/ruby/compass_0.11/sass-3.1.4/lib/sass/plugin/staleness_checker.rb:152:in `dependency_updated?'
org/jruby/RubyEnumerable.java:1356:in `any?'
/Applications/compass.app/Contents/Resources/ruby/compass_0.11/sass-3.1.4/lib/sass/plugin/staleness_checker.rb:119:in `dependencies_stale?'
/Applications/compass.app/Contents/Resources/ruby/compass_0.11/sass-3.1.4/lib/sass/plugin/staleness_checker.rb:152:i
@maylogger
maylogger / gist:1225164
Created September 18, 2011 15:27
wp-config.php db setting for heroku
// ** MySQL settings - You can get this info from your web host ** //
$db = parse_url($_ENV["DATABASE_URL"]);
/** The name of the database for WordPress */
define('DB_NAME', trim($db["path"],'/'));
/** MySQL database username */
define('DB_USER', $db["user"]);
/** MySQL database password */