Search

9/28/2012

Emoji cheat sheet

Emoji cheat sheet

Emoji emoticons are supported on Campfire, GitHub, Basecamp, Turntable.fm, and Teambox. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet.

Google Goggles

Google Goggles

Search by taking a picture: point your mobile phone camera at a painting, a famous landmark, a barcode or QR code, a product, a storefront, or a popular image. If Goggles finds it in its database, it will provide you with useful information. Goggles can read text in English, French, Italian, German, Spanish, Portuguese, Russian, and Turkish, and translate it into other languages. Goggles also works as a barcode / QR code scanner.

ps to css

CSS Hat turns Photoshop layer styles to CSS3 with a click - PSD ...

CSS Hat is a Photoshop plugin that converts layer styles to CSS3 with a single click. PSD to CSS easily.
CSS3Ps - free cloud based photoshop plugin that converts layers to ...
CSS3Ps is a free, cloud based, photoshop plugin for converting layers to CSS3 styles.

First Seed Material

First Seed Material - animation sprite material http://www.tekepon.net/fsm/modules/refmap/index.php?mode=vx-chara via: http://dabblet.com/gist/2076449

icon fonts collection

Icon Fonts | Pictonic.co The Big List of Flat Icons & Icon Fonts | CSS-Tricks iconmelon IKONS - 264 free vector icons from Piotr Kwiatkowski LivIcons - Exclusive Truly Animated Icon Pack!

yeoman/yeoman

yeoman/yeoman

Yeoman uses:

mac tips

大家知道在finder裡頭  選某一個檔案  然後按空白鍵   會出現預覽模式嗎?   這時候可以按上下左右瀏覽檔案 在瀏覽照片的時候很好用

1957-58 Taiwan - Tom Jones - Picasa 網路相簿

1957-58 Taiwan - Tom Jones - Picasa 網路相簿

gdipp - Customizable Windows text renderers - Google Project Hosting

gdipp - Customizable Windows text renderers - Google Project Hosting

The gdipp (codename) project is a replacement of the Windows text render, which brings to you the effect of text like Mac OS and Linux distributions. It is easy to use with ignorable overhead, and it is fully customizable. The project is originated as the relaunch of the suspended gdi++.dll project. Like the InkStone project, we found the source code of gdi++.dll project too complex to manage, and decide to start over a new code base. The goal of gdipp project is to continue the development of gdi++, expand functionality, improve performance, provide better compatibility for the current and future Windows versions (potentially at the cost of removing compatibility for old Windows), create detailed and formal documentation, as well as tools to help using it. gdipp Project supports both 32-bit and 64-bit Windows 7/Vista. You can install 32-bit and 64-bit components separately. The 32-bit components only renders 32-bit applications, while the 64-bit components only renders 64-bit applications in 64-bit Windows. Both components share the same setting file. gdipp also works correctly on Windows XP and 2003. However, due to the significant difference in the system architectures, the rendering may be less stable and compatible. gdi++ or ezgdi are alternative choices of Windows text renderers.

9/25/2012

Adobe® Edge Web Fonts

Adobe® Edge Web Fonts

URL Specification The URL in the JavaScript tag determines which fonts are loaded into your page. Here’s the spec for that URL.
use.edgefonts.net/[<family>[:<fvd...>[:<subset>]]...].js
Let’s break down the parts that are variable. Each of these elements is separated by a colon (:). family The name of a font family. See the available fonts. fvd One or more Font Variation Descriptions separated by a comma (,). subset The name of a subset. The available values are default and all. Include multiple families by separating them with a semicolon (;). Both the fvd and subset parameters are optional. If you omit fvd, the response will contain fonts from the “basic four” set: regular, italic, bold, and bold italic (n4,i4,n7,i7). If a family contains none of the basic four, the response will contain no fonts for that family. If subset is omitted, default will be used.
# One family with default options (results in n4,i4,n7,i7)
# and the "default" subset).
use.edgefonts.net/averia-libre.js

# One family in two styles. Averia Libre Light (n3) and
# Light Italic (i3) in the "default" subset.
use.edgefonts.net/averia-libre:n3,i3.js

# One family, in one style, in the "all" subset.
use.edgefonts.net/averia-libre:n3:all.js

# Two families. Averia Libre Regular (n4) in the "default"
# subset, and Bree Serif Regular (n4) in the "all" subset.
use.edgefonts.net/averia-libre:n4;bree-serif:n4:all.js

# Two families with default options.
use.edgefonts.net/averia-libre;bree-serif.js

9/24/2012

Use CSS to Specify the Aspect Ratio of a Fluid Element

Use CSS to Specify the Aspect Ratio of a Fluid Element - if you want the height of a container is 50% width of it's parent, and want the height of the container the same as its width, pure css.

margin-top:75% gives the box of the dummy element a height that is 75% of the aforementioned width, thus defining the aspect ratio. The key here is that a percentage value for margin-top or margin-bottom (or for padding-top or padding-bottom, for that matter) refers to the width of the containing block. Because the container is an inline-level block container, the height of the container is automatically computed as the height of the dummy element, which is based on the width of the container. Voilà, instant aspect ratio using only CSS.
some text
#container {
    display: inline-block;
    position: relative;
    width: 50%;
}
#dummy {
    margin-top: 75%; /* 4:3 aspect ratio */
}
#element {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: silver /* show me! */
}

dummy element用margin-top:75%, 是取parent container "寬"的75%, 把 #container 撐高, element取決對定位

via: height equal to dynamic width (CSS fluid layout)

CSS LAYOUT GETS SMARTER WITH CALC()

CSS LAYOUT GETS SMARTER WITH CALC()

It gives you two main features to make layout more flexible: Mixing percentages and absolute values. Mixing sizing units.
#bar {
  height: calc(10em + 3px); 
}
With calc() you can use +, -, * and / to add, subtract, multiply and divide values, allowing all sorts of possibilities. You can use calc() anywhere a CSS length or number can be used. We’re also working on adding calc() for angle and frequency properties soon. The calc() property for lengths is available now in Chrome 19 (Dev channel build) by use of the '-webkit-calc’ property, in Firefox since version 8 using the '-moz-calc’ property and in Internet Explorer since version 9 unprefixed.
http://caniuse.com/#search=calc -
ie>=9.0, all firefox, all chrome, safari >= 6.0

9/22/2012

台南/以結婚為前提 和台南交往吧! - 書海漫遊 - 達人帶路玩 - udn旅遊休閒

台南/以結婚為前提 和台南交往吧! - 書海漫遊 - 達人帶路玩 - udn旅遊休閒

只要是台南人,不管是那種在台南住了三代以上的家族,或是在台南出生成長而後移居他鄉,還是嫁到台南,在台南工作,在台南當兵,在台南讀書,或短暫住過幾年,或男友女友恰好是台南人,或某一年之後就在台南租屋買屋入籍…… 對這些廣義的台南人或台南周邊人口來說,一年之內起碼要被諮詢好幾次,台南哪裡好玩,哪裡好吃。 做為這些想要靠短期衝刺就把台南好吃好玩好悠閒的滋味一次嚐盡的導覽人,有時候也要煩惱錯誤的指引,會不會導致朋友們從此討厭台南。畢竟是自己喜愛的地方,有深情有牽掛,免不了內心湧現難以言喻的壓力。其實隨便搪塞一本旅遊導覽或資訊誌也行,可是這樣輕率簡直對不起台南各寺各廟的眾神明,三言兩語或兩天一夜就要把台南採取All You Can Eat的模式推銷出去,隱約還是感覺不夠誠意。 身為台南人,如果只是讓朋友來花園夜市吃到吐,一天半時間快速衝刺美食,而不帶他們去小巷散步,在廟口聊天,在悠閒的轉角老屋喝一杯咖啡或茶,那就是身為台南人的失職。 我自己反覆煩惱了很長一段時間,某次在準備一場網路聚會(Punch Party)的三十分鐘演說時,索性就將存在自己內心的台南畫出重點,也就在圖文整理成投影片的過程中,那個「三分靦腆、三分守舊、外加四分低調」卻還是抖不掉某種自豪成分的台南人性格,安安靜靜,就上身了。 若說那是台南人的老靈魂也不為過,某種被附身的高濃度使命感,就那樣坐在體內的中心點,最靠近心臟的位子,不斷耳提面命,剎那間,總算懂了。 要跟這個城市產生感情的方式,根本不是倉促短暫的一夜情,而是以「結婚為前提」的長久交往才是啊! 那時,心內立即浮現出生在府城台南的文壇耆老葉石濤的身影,有幾年讀著葉老的書,城內那些巷弄的時空磁場隨即倒轉,這個城市獨有的氣味簡直像老店的糕餅,入喉,就回甘了。葉老說,「台南是一個適合人們作夢、幹活、戀愛、結婚、悠然過活的地方」,每次自己發出小小聲音,反覆讀頌這段話,心胸就緩緩敞開來,猶如台南夏天盛開的鳳凰花那樣,再也沒有比這段話更能說出這個城市的優雅面容了。 對於那些教人如何短期衝刺的美食教戰密笈,總覺得對這個靜好的城市不成敬意,起碼應該醞釀那種深邃長久的交情,而不是走馬看花吃吃喝喝的一夜情,畢竟,台南是整個台灣歷史的縮影: 你應該知道熱蘭遮城與普羅民遮城的歷史地位,而不是匆促地去吃一碗蚵仔煎或棺材板; 妳可以走出車站月台就開始調整語言頻道,聽聽韻尾優美的府城腔調,即使去銀行辦事情也能夠台語一路暢通; 你應該去民權路走一走,那裡從明鄭時期就已經是台灣最早有商業行為的大街,有最早的律師事務所,最早的氣象觀測站,所謂戒嚴時期的黨外第一街。據說鄭和下西洋時,曾經繞道此地大井頭取水,而今那大井頭就躺在柏油路面,成為歷史的印記…… 譬如我們常常開玩笑說,台南即使被稱為「台獨基本教義派的城市」,卻有在地職棒球團名為「統一」; 九點過後,看棒球轉播的收視人口多過談話性節目; 某些店家老闆喜歡一邊做生意一邊唱卡拉OK; 即使穿短褲穿拖鞋也可以去逛百貨公司; 或上身穿得很潮,腳上一雙夾腳拖鞋也OK; 那些穿著有破洞的無袖汗衫,坐在亭仔腳吃麵的阿伯,有可能是某某老闆某某董事長…… 即使是偏僻的小巷內,也會出現幾百年歷史的廟宇; 那些坐在廟口下棋聊天的阿公,只要開口幾乎都是歷史的活字典; 一年到頭都有廟會祭典,台南人早就習慣開車騎車等紅燈的時候,旁邊站著七爺八爺媽祖關聖帝君或三太子…… 除非是颱風天,否則這個城市不太需要隨身攜帶無法折疊的大傘,連午後雷陣雨都乾脆,嘩啦啦一陣爽快,隨即撤退。 所以來到台南,抵達車站,踏上月台,不要被所有人整齊劃一的脫外套舉動嚇一跳,因為這個城市熱情乾爽,而且很堅強,不愛哭。 台南也有不可思議的反骨與念舊,號稱國際連鎖事業最難攻打的頑固戰區,譬如星巴克與三皇三家曾經打得難分難解; 早期在成大落腳的麥當勞曾經敗給89漢堡; 美而美比不上勝利早餐店; 養老乃瀧拚不過沙卡里巴「赤崁」老店; 五星級名廚打不贏阿霞飯店; 十年老店只是「細漢仔」,百年老店才是「老大」…… 台南還有超強的棒球基因,早年的郭泰源、莊勝雄、謝長亨; 闖蕩美國職棒的陳金鋒、王建民、郭泓志、胡金龍、林哲瑄; 挑戰日本職棒的林恩宇和鄭凱文; 還有年年出英雄的熱血高校野球傳統強隊南英小將…… 跟台南交往之前,先讀些書,譬如葉石濤的《紅鞋子》《賺食世家》; 譬如蕭麗紅的《桂花巷》; 譬如蔡素芬的《鹽田兒女》; 或者蘇偉貞的《租書店的女兒》……小說或敘事散文能給的,是一種深植內心的情緒,比那些地圖導覽還要來得深邃飽滿。 走吧,出發了。去那個適合作夢、幹活、戀愛、結婚、悠然過活的地方。 先把馱在肩上的身段與節奏一腳踢開; 找一個非假日,穿一雙好走的鞋,找一間老街的小旅館住幾晚; 或找台南人當嚮導,如果可以的話,乾脆住在他家; 借一部腳踏車,騎起來會嘎嘎叫的最好,要不然悠閒散步也很棒; 如果是開車前來,請關掉車上的衛星導航系統,因為台南的路是「長在嘴上」…… 跟著台南人的作息步調:早睡、早起,一定要睡午覺,一定要吃早餐…… 切記切記,每個台南人的心中,都有一張不容挑戰的美食地圖; 旅遊指南與觀光團常去的店家,不一定是最棒的; 不用瓷碗的店家就失格; 到了台南還只是想著台北永康街昂貴的芒果冰就遜掉; 夏天吃挫冰,冬天吃桂圓米糕糜; 沒吃到薑糖醬油大蕃茄,等於沒來過台南; 在台南吃米糕與肉粽,千萬不能要求店家給妳紅吱吱的甜辣醬,那不是台南人吃米糕與肉粽的規矩…… 找一家老餅舖吃傳統台式糕餅; 一定要吃台南滷麵; 一定要嚐嚐北部很少見的水煮珍珠玉米; 一定要去菜市場,譬如大菜市、水仙宮市場、鴨母寮菜市、東菜市和崇誨空軍市場; 一定要去逛夜市,大東、武聖、花園。去撈金魚、打彈珠、吃雞蛋冰,找玻璃牛奶瓶…… 夏天記得來看鳳凰花,如蕭麗紅在《千江有水千江月》描述的:「從窗戶望出去,都是火紅紅、燒開來的鳳凰花……」 一定要去全美戲院朝聖,那是李安導演的青春和所有台南學子的新天堂樂園; 一定要去台南舊都廳改建的台灣文學館; 不要錯過小巷弄的老房子和大馬路旁邊的古樓,因為台南是一個對老房子有感情的地方; 一定要去昔日「末廣町」……今天的中正路瞧一瞧「林百貨」和對面的「勸業銀行台南支店」也就是今天的土地銀行…… 我常常覺得,一個城市如果沒有記憶,那就是死了,而一個城市要有記憶,老房子的身世就絕對不能草率被怪手剷平。應該是媽祖保佑,台南有一批年輕世代號召成立了「老房子事務所」,讓新行業進入老房子的靈魂,因而有了重生的機會。 譬如南門路的「草祭水又書店 」「小說咖啡」和「窄門咖啡」; 公園路氣象站對面的「奉茶」; 大菜市的「謝宅一號店」與保安路的「謝宅三號店」; 衛民街的「鹿早茶屋」; 民生路的「破屋」與青年路鐵道旁邊的「Kinks」; 長榮路的「A Room」咖啡; 正興街的「IORI」茶館; 台南人在七夕做16歲的七娘媽亭附近也有「甘單咖啡」與「寮國咖啡」; 還有躲在東寧路小巷內的「咖啡是實」…… 我很貪心,像個嘮叨的帶路人,唯恐閃失,漏掉什麼,倘若這樣,就愧對這個城市曾經耐心餵養我的諸多美好。 然後你也許就清楚了,這個「一言難盡」的城市,這個每走幾步路就想要坐下來吃點東西也剛好都不會讓人失望的美食勝地,許多店家即使與你不熟識,還是跟你招呼「來坐」。倘若你有機會走進一條小巷弄,一個村落,看見那些阿叔阿嬸阿公阿嬤,他們不只招呼你「來坐」,還問你「呷飽未」,你說不定在內心想著,到底是怎樣的歷史基因,讓這個城市那般從容不迫。 我其實不愛那些行銷字眼,說這裡有「王城氣度」,說這裡是「沒落的貴族」,但明明台南人的氣度或即使有某種隱性的驕傲,向來都掩藏得好好的。有時候不熟的人來了,就只是微笑,倘若對方有脾氣,那也只是微笑,內心決定不得罪,但也決定不深交就是了,沒必要爭辯。可是捍衛的城池那樣明確,不管是實體的或是內心的,一旦被激怒了,台南人又是那般反骨,不妥協。你說這樣子也未免太抽象了,但我身為台南的女兒,約莫能解釋的就是如此了。那些無法言喻的情感,如非在這裡住上三代,好像也說不出個所以然,但嘴裡說得那樣華麗多彩,還不如內心彼此理解就好。 反正,我喜歡安安靜靜,恬恬淡淡,有脾氣,卻不尖銳的台南。 來吧,歡迎來到這個適合作夢、幹活、戀愛、結婚、悠然過活的地方。請以結婚為前提,和台南交往吧! 圖片故事:【全美看板】 全美戲院,台南學子心目中的「新天堂樂園」。我在這裡看過無數的經典西片,雖然是二輪,兩片同映,但無損於這個戲院綻放出來的青春光澤。 全美的前身是日治時期的「第一全成戲院」,位於大宮町一丁目,至今仍然是專業師傅的手繪電影看板,照片中的右下角,逆向機車等待紅燈的位置,是「大井頭」遺跡所在。 全文網址: 台南/以結婚為前提 和台南交往吧! - 書海漫遊 - 達人帶路玩 - udn旅遊休閒 http://travel.udn.com/mag/travel/storypage.jsp?f_ART_ID=53400#ixzz27Bouk14R Power By udn.com

bashmarks - directory bookmarks for the shell

bashmarks - directory bookmarks for the shell

installation
git clone git://github.com/huyng/bashmarks.git
cd bashmarks && make install
add source ~/.local/bin/bashmarks.sh from within your ~.bash_profile or ~/.bashrc file
shell commands
s  - Saves the current directory as "bookmark_name"
g  - Goes (cd) to the directory associated with "bookmark_name"
p  - Prints the directory associated with "bookmark_name"
d  - Deletes the bookmark
l                 - Lists all available bookmarks
where bashmarks are stored All of your directory bookmarks are saved in a file called “.sdirs” in your HOME directory.

justfont blog - 字體123:我可能不會注意的字體冷知識

justfont blog - 字體123:我可能不會注意的字體冷知識

Leam to Kem? Learn to Kern? 上面這張圖的意思是說,如果沒有好的kerning,就會把rn連在一起,變成了m;拉丁字中有特定幾個字若是太近,會影響辨識度,就有如上面的例子。kerning的技巧正是在此時派上用場,調整特定字母的距離,增加字體的辨識程度。話說,"typograpy"原本是來自於活版印刷。早在這種古早年代,西方人就發現會有這樣的問題。例如下圖的T,如果沒有特殊處理,會跟兩邊的字母隔得太遠,導致有"SEE YOU A T NINE."這種令人不解的拼字。所以他們就發明了Kerning這個技巧,來把特定字母與兩邊字母的距離正常化。 如同所見,右邊的T稍微突出方塊,才能在印刷時與前一個字母保持合理距離。 其實,"kerning"一詞的字源來自"corner",強調的是一個字母語兩邊合宜的距離關係。"kerning"這個詞在k與e之間,r與n之間其實就有kerning,保持適當距離,提高辨識度。只是,kerning並不能被理解為「字元間距」,字元間距是上面那張圖的第二個:tracking。 每個字元的距離就是tracking 在網頁排版的css語法中,相對應"tracking"的語法就是letter-spacing,描述的是每個字母之間的平均距離。例如這個單字tracking就採取了0.5em的字元間距。tracking與kerning具體而言的差異是,tracking只是有關於調整每個字母之間的「平均」距離;而kerning雖然也是調整距離的概念,但強調的是一個單字中,特定字母的合宜距離,這種距離對辨識度很重要。 Leading不是領導,是行距 其實在typography中,leading發音為"ledding",而不是領導的進行式那個發音。但說來也巧,leading可以說是字型排版學中一個無比重要的觀念,有如引領眾規則的老大。因為適當的行距給了字體呼吸空間,當然也就讓內容更加好讀了;但如果連呼吸空間都未顧及,那麼其他再好的排版設計都沒有用。而且行距的設定其實也是有學問的。在傳統的平面設計中,垂直的韻律就是一種設定行距的規則,而且不管印刷或螢幕顯示都相當適用。 字型、字體,傻傻分不清楚 其實寫文章的時候,我們也會兩者混用。但字型(fonts)與字體(typeface)是不完全一樣的概念。這仍舊要追溯到古早的活字。那個時候,一個字型就是一塊金屬(鉛塊、木頭)上面刻的字,它的樣式(例如粗體、斜體)以及大小是固定不變的。嚴格來說,這才叫做一種「字型」;而「字體」則是同一款字型的「集合」:在相同的風格中,一套字體有不同的粗細、大小與樣式。例如,信黑體W3的12號字是一種字型,但信黑體本身是一套「字體」。然而,在數位時代中,數位字型可以被輕易的放大縮小,以至於字型與字體兩種概念的分野似乎不再那麼重要。但我們還是希望能夠強調字體這種成「套」的概念。因為在設計上很少只用到一種字型,必須要使用字體,才能同時風格一致,又能用各種不同粗細大小的字互補。

The Making of Octicons

The Making of Octicons

Glyph - font creating/editing tool Font Squirrel @font-face generator. - convert ttf/otf to other font format and generate css syntax http://maxvoltar.com/archive/-Webkit-font-smoothing
-webkit-font-smoothing: none;
-webkit-font-smoothing: subpixel-antialiased;
-webkit-font-smoothing: antialiased;
http://www.usabilitypost.com/2010/08/26/font-smoothing/
The first one will turn font smoothing off, showing your text with jagged sharp edges. The second one is what we see as default font smoothing on modern operating systems. It uses subpixel rendering to increase the apparent resolution of the display, which helps render crispier, sharper text. The last one is most interesting. It turns subpixel rendering off and instead uses the standard antialiasing technique to make fonts look smoother. Here’s a good article on the three Webkit modes together with some examples. I’m starting to see more and more sites using Webkit’s antialising font smoothing mode instead of the default subpixel one. I think it’s a pretty bad idea, especially when applied to body font. See, subpixel rendering is used for a very good reason. Each pixel on the screen isn’t just one little square of light, it’s actually three stripes (sometimes circles or squares) colored red, green and blue. Each of these subpixels can be turned to different intensities, which allows them to be used for extra detail. So instead of using all 3 simultaneously as one pixel, we use these subpixels individually to draw sharper shapes at very small sizes. The antialiasing mode of font smoothing turns this feature off and instead uses whole pixels to render the fonts. This makes the fonts look thinner, weaker and blurrier because the resolution is now effectively lower than before. Some say that the standard OS X font rendering is quite thick and strong—that may be compared to Windows (because OS X doesn’t rely on font hinting which aligns fonts at small sizes to individual pixels)—but its use of subpixel rendering also makes it sharp at small sizes. Turning subpixels off just makes it less readable, even if at first the thinner lines seem appealing. It’s surprising that even the BBC is doing it on their new site. I think it’s a case of using something just because it’s there, and not really thinking through the reasons behind it. Actually, I can’t find a good reason to use antialiasing right now instead of subpixel rendering. I’m not sure that taste is a good argument for this because what you do get are fonts rendered at lower resolution, which are weaker and less crisp than their subpixel counterparts. Don’t sacrifice readability for appearance.

9/17/2012

iTunes 10 for Mac: Add items to your library without copying them to your iTunes folder

iTunes 10 for Mac: Add items to your library without copying them to your iTunes folder

To add files to your library without adding them to your iTunes folder: Choose iTunes > Preferences, and click Advanced. Deselect the “Copy files” checkbox. From now on, when you drag a file to your library or choose File > Add to Library, the item appears in iTunes, but the actual file isn’t copied or moved.

9/16/2012

What Mark Zuckerberg's really said about HTML5 at Disrupt yesterday.

What Mark Zuckerberg's really said about HTML5 at Disrupt yesterday.

Yesterday, at Disrupt SF, Mark Zuckerberg discussed Facebook's mobile strategy. In the process he made a few comments about HTML5. Predictably news outlet and social media were quick to jump on them. Quotes were taken out of context and conclusions hastily drawn. In order to set the record straight, I wanted to share the transcript with you and let you draw your own, informed conclusions: "When I'm introspective about the last few years I think the biggest mistake that we made, as a company, is betting too much on HTML5 as opposed to native... because it just wasn't there. And it's not that HTML5 is bad. I'm actually, on long-term, really excited about it. One of the things that's interesting is we actually have more people on a daily basis using mobile Web Facebook than we have using our iOS or Android apps combined. So mobile Web is a big thing for us." --Mark Zuckerberg, Disrupt SF, September 2012.

9/13/2012

麥米魯

麥米魯 - 啤酒批發, 團購

The Download Attribute a[download]

The Download Attribute a[download]

syntax:

<a href="../../dr-evil-802.jpg" download="evil">download me</a>
window.addEventListener('load', function (e) {
    var MIME_TYPE = 'text/x-vcard';

    var link = document.getElementById('virtual-file-link');
    var contact = document.getElementById('contact');
    var obj = navigator.microformats.get('hCard', contact);

    obj = obj.microformats.vcard[0];
    var name = obj.fn.replace(/ /gi, '_');
    var vcard = hCardtovCard(obj);

    window.URL = window.webkitURL || window.URL;
    window.BlobBuilder = window.BlobBuilder
        || window.WebKitBlobBuilder
        || window.MozBlobBuilder;
    var builder = new window.BlobBuilder();
    builder.append(vcard);

    link.download = name + '.vcf';
    link.href = window.URL.createObjectURL(builder.getBlob(MIME_TYPE));
});
DownloadUrl Support - Dragging files to the desktop
var link = document.getElementById('draglogo');

link.addEventListener("dragstart", function (e) {
    e.dataTransfer.setData("DownloadURL", 
        "image/png:logo.png:http://glennjones.net/images/logo16.png");
});
Offer files for download in HTML5: a[download]
The new attribute download for <a> tags allows one to offer a file for download – instead of displaying it in the browser. Previously. Normally, when you click on an <a> tag, the web browser visits the file it refers to. Sometimes, you instead want the file to be downloaded. Most browsers usually ask the user to confirm before starting the download. Previously, you had to send the following HTTP header to make that happen.
Content-Disposition: attachment; filename=my-icon.png
Now. The new attribute download ensures that a file is downloaded and not displayed.
    <a href="http://example.com/3zw1456.png"
       download="my-icon.png"
    >download me</a>
Giving the attribute a value allows you to control the name of the file that is saved to disk. Use case. This feature is especially useful if you are working with URLs coming from Blob instances (which include File instances in the user’s file system) and FileEntry instances (in browser-local sandboxed file systems). With download, their data becomes downloadable.

http://chunghe.googlecode.com/svn/trunk/experiment/html5.download.attribute/index.htm

9/10/2012

javascript - Resizing an image in an HTML5 canvas - Stack Overflow

javascript - Resizing an image in an HTML5 canvas - Stack Overflow

demo:

http://chunghe.googlecode.com/svn/trunk/project/canvas-resize/index.htm
//returns a function that calculates lanczos weight
function lanczosCreate(lobes){
  return function(x){
    if (x > lobes) 
      return 0;
    x *= Math.PI;
    if (Math.abs(x) < 1e-16) 
      return 1
    var xx = x / lobes;
    return Math.sin(x) * Math.sin(xx) / x / xx;
  }
}

//elem: canvas element, img: image element, sx: scaled width, lobes: kernel radius
function thumbnailer(elem, img, sx, lobes){ 
    this.canvas = elem;
    elem.width = img.width;
    elem.height = img.height;
    elem.style.display = "none";
    this.ctx = elem.getContext("2d");
    this.ctx.drawImage(img, 0, 0);
    this.img = img;
    this.src = this.ctx.getImageData(0, 0, img.width, img.height);
    this.dest = {
        width: sx,
        height: Math.round(img.height * sx / img.width),
    };
    this.dest.data = new Array(this.dest.width * this.dest.height * 3);
    this.lanczos = lanczosCreate(lobes);
    this.ratio = img.width / sx;
    this.rcp_ratio = 2 / this.ratio;
    this.range2 = Math.ceil(this.ratio * lobes / 2);
    this.cacheLanc = {};
    this.center = {};
    this.icenter = {};
    setTimeout(this.process1, 0, this, 0);
}

thumbnailer.prototype.process1 = function(self, u){
    self.center.x = (u + 0.5) * self.ratio;
    self.icenter.x = Math.floor(self.center.x);
    for (var v = 0; v < self.dest.height; v++) {
        self.center.y = (v + 0.5) * self.ratio;
        self.icenter.y = Math.floor(self.center.y);
        var a, r, g, b;
        a = r = g = b = 0;
        for (var i = self.icenter.x - self.range2; i <= self.icenter.x + self.range2; i++) {
            if (i < 0 || i >= self.src.width) 
                continue;
            var f_x = Math.floor(1000 * Math.abs(i - self.center.x));
            if (!self.cacheLanc[f_x]) 
                self.cacheLanc[f_x] = {};
            for (var j = self.icenter.y - self.range2; j <= self.icenter.y + self.range2; j++) {
                if (j < 0 || j >= self.src.height) 
                    continue;
                var f_y = Math.floor(1000 * Math.abs(j - self.center.y));
                if (self.cacheLanc[f_x][f_y] == undefined) 
                    self.cacheLanc[f_x][f_y] = self.lanczos(Math.sqrt(Math.pow(f_x * self.rcp_ratio, 2) + Math.pow(f_y * self.rcp_ratio, 2)) / 1000);
                weight = self.cacheLanc[f_x][f_y];
                if (weight > 0) {
                    var idx = (j * self.src.width + i) * 4;
                    a += weight;
                    r += weight * self.src.data[idx];
                    g += weight * self.src.data[idx + 1];
                    b += weight * self.src.data[idx + 2];
                }
            }
        }
        var idx = (v * self.dest.width + u) * 3;
        self.dest.data[idx] = r / a;
        self.dest.data[idx + 1] = g / a;
        self.dest.data[idx + 2] = b / a;
    }

    if (++u < self.dest.width) 
        setTimeout(self.process1, 0, self, u);
    else 
        setTimeout(self.process2, 0, self);
};
thumbnailer.prototype.process2 = function(self){
    self.canvas.width = self.dest.width;
    self.canvas.height = self.dest.height;
    self.ctx.drawImage(self.img, 0, 0);
    self.src = self.ctx.getImageData(0, 0, self.dest.width, self.dest.height);
    var idx, idx2;
    for (var i = 0; i < self.dest.width; i++) {
        for (var j = 0; j < self.dest.height; j++) {
            idx = (j * self.dest.width + i) * 3;
            idx2 = (j * self.dest.width + i) * 4;
            self.src.data[idx2] = self.dest.data[idx];
            self.src.data[idx2 + 1] = self.dest.data[idx + 1];
            self.src.data[idx2 + 2] = self.dest.data[idx + 2];
        }
    }
    self.ctx.putImageData(self.src, 0, 0);
    self.canvas.style.display = "block";
}
Lanczos resampling - Wikipedia, the free encyclopedia

Color Hex - ColorHexa.com

http://www.colorhexa.com/faaceb - compute 'Analogous Color', 'Complementary Color' along with others

Gradient generator Color blender 216 web safe colors Colors by name

Amazon’s Pure CSS Solution to Avoid Cutting Off Text

Amazon’s Pure CSS Solution to Avoid Cutting Off Text - oldie but goodie

background-image: -webkit-linear-gradient(bottom, white 15%, rgba(255, 255, 255, 0) 100%);
Update: Syd Lawrence points out that it’s worth using pointer-events: none on the mask. This is the CSS property that makes the front layer porous, allowing mouse clicks to cheekily slip through to the element behind it.

tiltShift.js - a jQuery plugin using CSS3 filters to replicate the tilt shift effect

tiltShift.js - a jQuery plugin using CSS3 filters to replicate the tilt shift effect

9/09/2012

Russia in color, a century ago - The Big Picture - Boston.com

Russia in color, a century ago - The Big Picture - Boston.com

In those years, photographer Sergei Mikhailovich Prokudin-Gorskii (1863-1944) undertook a photographic survey of the Russian Empire with the support of Tsar Nicholas II. He used a specialized camera to capture three black and white images in fairly quick succession, using red, green and blue filters, allowing them to later be recombined and projected with filtered lanterns to show near true color images. The high quality of the images, combined with the bright colors, make it difficult for viewers to believe that they are looking 100 years back in time - when these photographs were taken, neither the Russian Revolution nor World War I had yet begun.

Pose running technique training (before and after)

Pose running technique training (before and after)

9/01/2012

台南 日租 民宅 民宿

台南 日租 民宅 民宿

復興路。小隱

有方公寓

鐵花窗民居

正興咖啡館

木子到森 Mozidozen

木‧18

六圓(南)

毛屋‧台南漁光島

跳屋子

銅錢草B&B,tea house

屎溝墘客廳

轉圈圈Home stay

宿囍 Backpacker

Dorm 1828

油行尾

慢步。南國

靜巷十號

來七逃旅店

台窩灣

跳房子

Tavern L

Dodoro's hostel

Iris tower

波夏122

台南夢想套房

許願宿

8招健身2/腹肌無力 仰臥起坐練再多 無效!

8招健身2/腹肌無力 仰臥起坐練再多 無效!

1.趴臥,採取膝蓋的「四足跪姿」,之後慢慢將屁股抬高,膝蓋脫離地面,利用手肘的力量把身體撐起來。最好的姿勢是膝蓋懸空、腿打直的「棒式」,但女性如果手臂較無力、撐不太起來,則可以將膝蓋跪地做支撐。 2.每次撐起時間維持30秒,30秒時稍休息3至5秒後,再撐起30秒,總共進行1分鐘的時間,男性可以加做腳左右旋轉的作用,可以強化側腹肌的鍛鍊。 小叮嚀:這個動作可練習腹部的肌肉,而撐地的動作,手臂「拜拜肉」的肌肉也會練習到,男性加做腿部的左右旋轉,增加扭力,可以使腹部、腿和側腹肌更強化。 1.躺臥,兩手張開平貼在地面,可做為輔助支撐,之後雙腿一起抬起,盡量和身體呈90度腳,Luke說,動作的重點要注意腰和臀必須平貼著地面,後腰僅能留一個手掌高度的空隙,以維持人體弧形脊椎。 2.整個動作維持1分鐘。腿力較好者,可採取進階版,將雙腿彎曲,大腿和小腿呈90度角後,再伸直、再彎曲。 小叮嚀:Luke表示,很多女性年過30以後,腹肌幾乎完全無力,所以不管怎麼努力做仰臥起坐,因為腹肌無力,所以練到的都是頸部肌肉或是背部肌肉,腹部肌肉還是沒有練到,腹肌依舊無力。仰臥抬腿主要動用到腹肌的力量,比仰臥起坐更有效練到腹肌。