Tumgik
feyaway-blog · 10 years
Quote
Go to Applications>Utilities>Audio Midi Setup. Click "Built-in Output." You'll see that the "Format" is defaulted at 2ch-16 Integer, which for some reason is buggy and noisy on Macs. Change it to any one of the other options (20, 24, 32 bit).
Retina MBP has static on the headphone output
0 notes
feyaway-blog · 10 years
Quote
# dp Density-independent Pixels - An abstract unit that is based on the physical density of the screen. These units are relative to a 160 dpi (dots per inch) screen, on which 1dp is roughly equal to 1px. When running on a higher density screen, the number of pixels used to draw 1dp is scaled up by a factor appropriate for the screen's dpi. Likewise, when on a lower density screen, the number of pixels used for 1dp is scaled down. The ratio of dp-to-pixel will change with the screen density, but not necessarily in direct proportion. Using dp units (instead of px units) is a simple solution to making the view dimensions in your layout resize properly for different screen densities. In other words, it provides consistency for the real-world sizes of your UI elements across different devices. # sp Scale-independent Pixels - This is like the dp unit, but it is also scaled by the user's font size preference. It is recommend you use this unit when specifying font sizes, so they will be adjusted for both the screen density and the user's preference. # pt Points - 1/72 of an inch based on the physical size of the screen. # px Pixels - Corresponds to actual pixels on the screen. This unit of measure is not recommended because the actual representation can vary across devices; each devices may have a different number of pixels per inch and may have more or fewer total pixels available on the screen. # mm Millimeters - Based on the physical size of the screen. # in Inches - Based on the physical size of the screen.
Android API>..>Dimension
0 notes
feyaway-blog · 10 years
Quote
The use of the flags parameter in the String.replace method is **non-standard**. For cross-browser compatibility, use a RegExp object with corresponding flags. var regex = new RegExp(variable, 'gi'); questionText = questionText.replace(regex, rep);
SO: Why doesn't the javascript replace global flag work in Chrome or IE, and how to I work around it?
0 notes
feyaway-blog · 10 years
Text
考据>`extends` 关键字
最近开始用 jade, 发现 extends 关键字用了第三人称单数, includes 特性的关键字却是 include(没有 s). 于是想找找其他用到这个关键字的地方
首先想到 sass 里用的原形 extend
基友提醒下发现 extends 原来是 ES 保留字(coffee 的 class 也是用的 extends)
0 notes
feyaway-blog · 10 years
Quote
``` img{display:block;} ``` Images are by default displayed inline - which causes the padding below the image. (because of line-height) This issue could also be solved by setting the font-size to 0 (thus no additional height is needed) or forcing the line-height to be 0 (this will ofcourse create a vertical scroll bar). Also, any whitespace after an inline element will be considered as ' ' (space) in HTML.. All these combined, explain why treating the images as blocks makes most sense in this case. ----- 所以给外面的元素设置 `line-height: 0` 也可行(`line-height`被继承), 不过还是全局 `img{display:block;}` 来得方便...
IMG has 5px extra padding at bottom of div
0 notes
feyaway-blog · 10 years
Link
0 notes
feyaway-blog · 10 years
Link
0 notes
feyaway-blog · 10 years
Link
grunt-svgstore
SVG symbol a Good Choice for Icons
Why <symbol> is better for icons Just to put a point on it:
The viewBox can be defined on the symbol, so you don't need to use it in the markup (easier and less error prone). title and desc tags can be added there as well, making accessibility easier to do right. Symbols don't display as you define them, so no need for a <defs> block. This is probably what <symbol> was invented for anyway.
是时候从 web font 坑跳 svg sprites 坑了
0 notes
feyaway-blog · 10 years
Quote
The CSS `linear-gradient()` function creates an **``** which represents a linear gradient of colors. The result of this function is an object of the CSS `` data type.
MDN>CSS>linear-gradient
0 notes
feyaway-blog · 10 years
Link
mark
0 notes
feyaway-blog · 10 years
Link
Creating DOM Elements From a String
var stringToDom = function(str) { var temp = document.createElement('div'); temp.innerHTML = str; return temp.childNodes[0]; } var text = stringToDom('<div>Simple text</div>'); document.querySelector('body').appendChild(text); var tableRow = stringToDom('<tr><td>Simple text</td></tr>'); document.querySelector('body').appendChild(tableRow);
It looks like our stringToDom function created just a text node and not the actual <tr> tag...The problem is that the string containing the HTML element is run through a parser in the browser. That parser ignores the tags that are not placed in the right context, and we get only a text node. A table row without a table is not valid for the browser.
demo
0 notes
feyaway-blog · 10 years
Link
Now I've to say, i don't like and and i now is obsolete stuff, so i'm happy if they will be deprecated soon, but I think we need some pure DOM solution to draw polygons.
In my case, I'm trying to implement a pure DOM clickable pie-slices (not with Canvas or SVG just because it need to be a cross browser app).
So I did it in the easiest way: images for slices and the old fashioned tag....
but... i've fluid images with size in percentage.
好在找到了这个
0 notes
feyaway-blog · 10 years
Quote
* All CSS syntax is case-insensitive within the ASCII range (i.e., [a-z] and [A-Z] are equivalent), except for parts that are not under the control of CSS. For example, the case-sensitivity of values of the HTML attributes "id" and "class", of font names, and of URIs lies outside the scope of this specification. Note in particular that element names are case-insensitive in HTML, but case-sensitive in XML. * In CSS, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [a-zA-Z0-9] and ISO 10646 characters U+00A0 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a digit, two hyphens, or a hyphen followed by a digit. Identifiers can also contain escaped characters and any ISO 10646 character as a numeric code (see next item). For instance, the identifier "B&W?" may be written as "B\&W\?" or "B\26 W\3F". Note that Unicode is code-by-code equivalent to ISO 10646 (see [UNICODE] and [ISO10646]). * In CSS 2.1, a backslash (\) character can indicate one of three types of character escape. Inside a CSS comment, a backslash stands for itself, and if a backslash is immediately followed by the end of the style sheet, it also stands for itself (i.e., a DELIM token).
W3>CSS2>Syntax>Characters and case
0 notes
feyaway-blog · 10 years
Link
Aliases:
This type of shortcut is the oldest for the Mac; its roots go all the way back to System 7. Aliases are created and managed at the Finder level, which means that if you're using Terminal or a non-Mac application, such as many UNIX apps and utilities, an alias won't work.
Symbolic Links:
This type of shortcut is part of UNIX and Linux file systems. Because OS X is built on top of UNIX, it fully supports symbolic links. Symbolic links are similar to aliases in that they are small files that contain the pathname to the original object. But unlike aliases, symbolic links don't contain the inode name of the object. If you move the object to a different location, the symbolic link will be broken, and the system won't be able to find the object.
Hard Links:
Like symbolic links, hard links are part of the underlying UNIX file system. Hard links are small files that, like aliases, contain the original item's inode name. But unlike aliases and symbolic links, hard links don't contain the pathname to the original object. You would typically use a hard link when you want a single file object to appear in multiple places. Unlike with aliases and symbolic links, you can't delete the original hard-linked object from the file system without first removing all hard links to it.
┌── ln(1) link, ln -- make links │ ┌── Create a symbolic link. │ │ ┌── the path to the intended symlink │ │ │ can use . or ~ or other relative paths │ │ ┌─────┴────────┐ ln -s /path/to/original /path/to/symlink └───────┬───────┘ └── the path to the original file/folder can use . or ~ or other relative paths
0 notes
feyaway-blog · 10 years
Quote
An **em** is a unit in the field of typography, equal to the currently specified point size. For example, one em in a 16-point typeface is 16 points Originally, the unit equaled the width of the capital "M" in the typeface and size being used, which gave the unit its name --- 最早是看到 kejun 在微博上问过 `em` 相关的问题,在知乎上又看到这个,记录一下
wiki:em
0 notes
feyaway-blog · 10 years
Link
A naked domain, also called a zone apex domain, is a domain that lacks a subdomain, including the www
CNAMEs Won’t Solve the Naked Domain Problem
DNS forbids CNAME records on the zone apex
0 notes
feyaway-blog · 10 years
Quote
Option 1.1 Option 2.1 Option 2.2 Option 3.1 Option 3.2 Option 3.3 **Note: Optgroup elements may not be nested.** ----- 看 [blueprintcss](http://www.blueprintcss.org/tests/parts/forms.html) 发现还有这么个标签 ----- [demo](http://jsfiddle.net/yaway/ra9t3u73/)
MDN>Web technology for developers>HTML>HTML element reference>optgroup
0 notes