- 編輯器設定 soft tab (space=2),以 2 格空白符號做為程式內縮距離(不分語言)。
- 函式如果只有一個參數,就不強制打()
- 函式如果有二個以上的參數,通通都要有 ()
- (避免發生奇怪的paser bug跟保持專案一致性)
- 字串限定用雙引號包覆
- 善用 "#{str1} #{str3} " 等字串改寫技巧取代不需要的字串加法。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- In Safari, this copies the Title and URL of the current tab to the clipboard. | |
-- Save the script in ~/Library/Scripts/Applications/Safari | |
-- Using QuickSilver, I assign a trigger to this script using the hotkey ⌥-C (option c), with the scope of the trigger limited to Safari. | |
-- Inspired by CopyURL + (http://copyurlplus.mozdev.org/) | |
-- Christopher R. Murphy | |
tell application "Safari" | |
set theURL to URL of front document | |
set theTitle to name of front document | |
set the clipboard to theTitle & return & theURL as string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 'rem' is a Sass mixin that converts pixel values to rem values for whatever property is passed to it. | |
* It returns two lines of code — one of the regular pixel values (for IE), and another with the | |
* converted rem values (for everyone else). Special thanks to Chris Epstein (http://chriseppstein.github.com) | |
* and Martin Bavio (http://martinbavio.com) for the help and code! | |
* | |
* Sample input: | |
* .element { | |
* @include rem('padding',10px 0 2px 5px); | |
* } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This mixin outputs a property with rem units and a px fallback. | |
// Values passed without units are used as multipliers for the final | |
// rem and px values, all other units are output without modification. | |
// $base-font-size represents the root value of the document font-size | |
// in pixels. | |
// | |
// i.e. html { font-size: 100%;} // -> 16px | |
// Usage: | |
// @include px-and-rem([property], [multiplier | explicit value] [, ...]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- Le styles --> | |
<link href="../bootstrap/css/bootstrap.css" rel="stylesheet"> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@main-font-size: 16px; | |
.x-rem (@property, @value) { | |
// This is a workaround, inspired by https://github.com/borodean/less-properties | |
@px-fallback: @value * @main-font-size; | |
-: ~`(function () { return ';@{property}: @{px-fallback}'; }())`; | |
-: ~`(function () { return ';@{property}: @{value}rem'; }())`; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inspired by this post from CSS-Tricks. | |
// http://css-tricks.com/snippets/css/less-mixin-for-rem-font-sizing/ | |
// | |
// Plays nice with compass/typography/vertical_rhythm | |
// http://compass-style.org/reference/compass/typography/vertical_rhythm/ | |
// | |
// Calculates font size in `rem` (root em). | |
// | |
// Relative values depends on $base-font-size. Pixle value for font-size depends | |
// on $legacy-support-for-ie6 or $legacy-support-for-ie7 or $legacy-support-for-ie8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#proposal #wrapper #comparison .graph { | |
position: relative; | |
height: 4rem; | |
display: block; // make sub div display in this div | |
float: left; // fix the display result | |
width: 25%; // fix the display result | |
} | |
screenshot:http://i.imgur.com/mGKUbzK.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x: 1 | |
y: require \./b.json.ls | |
z: require \./c.json.ls |
OlderNewer