<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[Lucifr]]></title>
  <link href="http://lucifr.com/atom.xml" rel="self"/>
  <link href="http://lucifr.com/"/>
  <updated>2012-03-15T08:57:27+08:00</updated>
  <id>http://lucifr.com/</id>
  <author>
    <name><![CDATA[Lucifr]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    
      <title type="html"><![CDATA[Sublime Text 2 + Gist = 代码片段管理器]]></title>
      <link href="http://lucifr.com/2012/03/07/sublime-text-2-plus-gist-equal-snippet-manager/"/>
    
    <updated>2012-03-07T19:12:00+08:00</updated>
    <id>http://lucifr.com/2012/03/07/sublime-text-2-plus-gist-equal-snippet-manager</id>
      
        <content type="html"><![CDATA[<p>来自 <a href="http://net.tutsplus.com/tutorials/tools-and-tips/sexy-code-snippet-management-with-gists/" title="Sexy Code Snippet Management With Gists | Nettuts+">Nettuts+ 的视频教程</a> （<a href="http://www.youtube.com/watch?v=3cdkYdzgXLc" title="Sexy Code Snippet Management With Gists">Youtube</a>/<a href="http://v.youku.com/v_show/id_XMzYyMDEyMTUy.html" title="Sexy Code Snippet Management With Gists - 视频 - 优酷视频 - 在线观看">优酷</a>），结合 <a href="http://lucifr.com/tags/sublime-text/">Sublime Text 2</a> 的 <a href="https://github.com/condemil/Gist" title="condemil/Gist · GitHub">Gist 插件</a>和 <a href="https://github.com" title="GitHub · Social Coding">Github</a> 提供的 <a href="https://gist.github.com/" title="Gist">Gist 代码片段分享平台</a>，打造出一个能够很方便的进行创建、搜索插入、更新以及版本控制的代码片段管理器。</p>

<p><embed src="http://player.youku.com/player.php/sid/XMzYyMDEyMTUy/v.swf" allowFullScreen="true" quality="high" width="480" height="400" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash"></embed></p>

<p>大致流程：</p>

<ol>
<li><p><a href="https://github.com/signup?return_to=gist" title="Sign up for GitHub · GitHub">建立一个 Gist 账户</a>。</p></li>
<li><p>通过 <a href="http://lucifr.com/139225/sublime-text-2-tricks-and-tips/#package_control" title="Sublime Text 2 入门及技巧 - Lucifr">Package Control</a> 安装 <a href="https://github.com/condemil/Gist" title="condemil/Gist · GitHub">Gist 插件</a>。</p></li>
<li><p>编辑 <strong>~/Library/Application Support/Sublime Text 2/Packages/Gist/Gist.sublime-settings</strong>，填入 Gist 账户名及密码。</p></li>
<li><p><strong>创建新的代码片段</strong>：用 Sublime Text 2 建立空白文档，输入/粘贴需要的代码片段（无需保存），通过命令框（<code>⌘+⇧+P</code>）调用 <strong>Gist:Creat Public Gist</strong> 建立 Gist。或是用默认快捷键 <code>⌘KI</code>（按住⌘后按K及I）。</p>

<p>由于 Gist 不提供分类，所以在输入 Description 时，最好使用“语言:名称”的形式以便于查找，如：“HTML: Starting Template”。</p></li>
<li><p><strong>调用代码片段</strong>：通过命令框调用 <strong>Gist:Open Gist</strong>，或是快捷键 <code>⌃⌘G</code>。</p>

<p>这时可以通过搜索框进行过滤，借助 Sublime Text 2 的实时匹配，可以很容易的找到你需要的片段，按下回车就会在新标签中打开，然后就可以复制粘贴到需要的地方了。</p>

<blockquote><p>  这个插件不支持直接插入，你也可以选择通过 Package Control 安装另外一个插件：<a href="https://github.com/bgreenlee/sublime-github" title="bgreenlee/sublime-github · GitHub">sublime-github</a>，支持复制到粘贴板 “<strong>Copy Gist to Clipboard</strong>”。</p></blockquote></li>
<li><p><strong>更新代码片段</strong>：通过 <strong>Gist:Open Gist</strong> 打开的片段，可以在修改后通过 <strong>Gist: Update File</strong> 进行更新。</p></li>
<li><p><strong>拿来主义</strong>：因为 Gist 本身就是一个代码分享平台，当你看到别人分享的优秀代码，可以直接 fork 过来为己所用。</p></li>
</ol>


<p>via <a href="http://net.tutsplus.com/tutorials/tools-and-tips/sexy-code-snippet-management-with-gists/" title="Sexy Code Snippet Management With Gists">Nettuts+: Sexy Code Snippet Management With Gists</a></p>
]]></content>
      
  </entry>
  
  <entry>
    
      <title type="html"><![CDATA[Quick Tweet ★]]></title>
      <link href="http://itunes.apple.com/us/app/quick-tweet/id505987287?mt=12"/>
    
    <updated>2012-03-07T18:33:00+08:00</updated>
    <id>http://lucifr.com/2012/03/07/quick-tweet</id>
      
        <content type="html"><![CDATA[<p><a href="http://itunes.apple.com/us/app/quick-tweet/id505987287?mt=12" title="Mac App Store - Quick Tweet">Quick Tweet</a>：由国人 @<a href="http://twitter.com/lembacon">lembacon</a> 制造的免干扰 <a href="http://lucifr.com/tags/twitter">Twitter</a> 客户端，免费，界面干净利落，功能简单到只有发（带图）推。</p>

<p><img src="http://cdn.lucifr.com/uploads/quick_tweet.jpg" alt="Quick Tweet" /></p>

<p>默认最前端显示，通过 Oauth 验证后，就可以把它拖到屏幕的一角，点击自己的头像或是按下全局快捷键 <code>⌘+⌥+N</code> 就会弹出编辑框，需要上传图片的话只要把图片拖进来，会上传到 Twitter 的图床中，按下 Send 按钮或是 <code>⌘+↩</code> 发送，发送成功后还有很萌的鸟叫声提示。</p>
<a rel="full-article" href="http://lucifr.com/2012/03/07/quick-tweet/">∞</a>]]></content>
      
  </entry>
  
  <entry>
    
      <title type="html"><![CDATA[BetterDictionary ★]]></title>
      <link href="https://github.com/pooriaazimi/BetterDictionary"/>
    
    <updated>2012-03-07T17:15:00+08:00</updated>
    <id>http://lucifr.com/2012/03/07/betterdictionary</id>
      
        <content type="html"><![CDATA[<p><img src="http://cdn.lucifr.com/uploads/betterdictionary-lion.png" alt="BetterDictionary" /></p>

<p><a href="https://github.com/pooriaazimi/BetterDictionary" title="pooriaazimi/BetterDictionary · GitHub">BetterDictionary</a>: 一个针对字典（Dictionary.app）的 <a href="http://www.culater.net/software/SIMBL/SIMBL.php" title="SIMBL">SIMBL</a> 插件，安装后可以对搜索过的词条进行保存。</p>

<p><a href="https://github.com/pooriaazimi/BetterDictionary/downloads" title="Downloads · pooriaazimi/BetterDictionary · GitHub">下载 BetterDictionary</a></p>
<a rel="full-article" href="http://lucifr.com/2012/03/07/betterdictionary/">∞</a>]]></content>
      
  </entry>
  
  <entry>
    
      <title type="html"><![CDATA[EpicEditor: 一个 Javascript Markdown 编辑器 ★]]></title>
      <link href="http://oscargodson.github.com/EpicEditor/"/>
    
    <updated>2012-03-07T00:27:00+08:00</updated>
    <id>http://lucifr.com/2012/03/07/epiceditor-a-javascript-markdown-editor</id>
      
        <content type="html"><![CDATA[<p><a href="https://github.com/OscarGodson/EpicEditor" title="OscarGodson/EpicEditor · GitHub">EpicEditor</a> 是一个基于 <a href="http://lucifr.com/tags/javascript">Javascript</a> 的 <a href="http://lucifr.com/tags/markdown">Markdown</a> 编辑器，可用于网页文本框，支持编辑和实时预览分栏的全屏模式，目前还处于 Alpha 阶段。在其<a href="http://oscargodson.github.com/EpicEditor/" title="EpicEditor - An embeddable JavaScript Markdown editor">主页</a>上可以查看<a href="http://oscargodson.github.com/EpicEditor/#example-1" title="EpicEditor - An embeddable JavaScript Markdown editor">实例</a>及 <a href="http://oscargodson.github.com/EpicEditor/#api" title="EpicEditor - An embeddable JavaScript Markdown editor">API</a>。</p>

<p>via <a href="http://thechangelog.com/post/18838719010" title="EpicEditor - an embeddable JavaScript Markdown editor - The Changelog - Open Source moves fast. Keep up.">The Changelog</a></p>
<a rel="full-article" href="http://lucifr.com/2012/03/07/epiceditor-a-javascript-markdown-editor/">∞</a>]]></content>
      
  </entry>
  
  <entry>
    
      <title type="html"><![CDATA[Cheaters]]></title>
      <link href="http://lucifr.com/2012/03/05/cheaters-cheat-sheet-system/"/>
    
    <updated>2012-03-05T10:03:00+08:00</updated>
    <id>http://lucifr.com/2012/03/05/cheaters-cheat-sheet-system</id>
      
        <content type="html"><![CDATA[<p><a href="http://brettterpstra.com/cheaters-customizable-cheat-sheet-system/">Cheaters</a> 是 Brett 大在 <a href="http://www.macdrifter.com/2012/02/markdown-cheat-sheets-and-marked/">Macdrifter</a> 折腾的基础上（话说这两个博客都很能折腾……）搞出的一个速查卡系统，可以把一些常用的快捷键、代码之类的整合起来，以便于查阅，当然这不是一个现成的程序，需要自己通过 Automator 来制作，如果需要添加新的速查卡，那么还需要一些 HTML 语法知识。</p>

<h3>制作方法</h3>

<ol>
<li><p>下载 <a href="http://brettterpstra.com/cheaters-customizable-cheat-sheet-system/#download">Cheaters.zip</a> 并解压，如果你在多个 Mac 之间使用，推荐放到 <a href="https://www.dropbox.com/referrals/NTgxODA4MDQ5">Dropbox</a> 目录里。</p></li>
<li><p>打开 Automator.app。</p></li>
<li><p>建立一个“应用程序（Application）”类的新项目。</p></li>
<li><p>在左侧的资源库中找到 “<strong>获得指定的 URL（Get Specified URLs）</strong>” 和 “<strong>网站弹出式菜单（Website Popup）</strong>”(可以通过搜索框查找)，依次拉到右侧的空白区域中。</p></li>
<li><p>“<strong>获得指定的 URL</strong>” 中默认的地址是 http://www.apple.com，双击进行更改，指向第一步中解压缩的 Cheaters 的 index.html，比如：</p>

<pre><code>file:////Users/Lucifr/Dropbox/Documents/Cheaters/index.html
</code></pre></li>
<li><p>在 “<strong>网站弹出式菜单</strong>” 中设置一个合适的大小，可以按照你屏幕的尺寸酌情调适，Cheaters 已经贴心的使用 responsive 的设计，而且弹出的窗口也可以进行手动缩放，所以尺寸不是什么大问题，如果不合适还可以再回来修改。</p>

<p><img src="http://cdn.lucifr.com/uploads/cheaters_01.jpg" alt="Cheaters Automator Setup" /></p></li>
<li><p>现在把这个项目取个名字（比如 Cheaters.app）保存到应用程序目录中（/Applications 或是 ~/Applications）就大功告成了。</p></li>
</ol>


<h3>使用</h3>

<ul>
<li>因为已经做成了应用程序，所以可以直接运行就可以了。当然通过 <a href="http://lucifr.com/tags/alfred">Alfred</a> 一类的快捷启动程式启动或是为其添加快捷键会更为方便一些。</li>
<li>Cheaters 并没有 Dock 图标，只是一个弹出式的窗口，按下 ⎋ 或是 ⌘+Q 就可以退出了。</li>
<li><p>Cheaters 默认已经加入了一些对程序猿来说很实用的速查卡，比如 HTML5、CSS3、jQuery、Markdown 语法等。同时还提供了明暗两种不同的主题风格。</p>

<p>  <img src="http://cdn.lucifr.com/uploads/cheaters_03.jpg" alt="Cheaters Dark" /></p></li>
</ul>


<h3>定制</h3>

<p>因为 Cheaters 完全基于 HTML 及 CSS，所以可以很方便的对已有的速查卡进行修改，或是添加新的速查卡。</p>

<p>比如 Lucifr 现在要添加一个 <a href="http://lucifr.com/139235/sublime-text-2-useful-shortcuts/" title="Sublime Text 2 实用快捷键[Mac OS X] - Lucifr">Sublime Text 2 快捷键</a>的页面，那么只要在 cheatsheets 子目录下新建一个 .html 文件，比如取名为 sublimetext2.html。内容上比对已有的文件，用表格组织即可：<a href="https://gist.github.com/1976157">sublimetext2.html</a></p>

<p>下一步要把已经新建立的速查卡添加到菜单中，直接编辑 index.html，在开始部分找到 <code>&lt;ul id="nav"&gt;</code>，把新文件按照格式包括进去就行了：</p>

<pre><code>&lt;li&gt;&lt;a href="cheatsheets/sublimetext2.html"&gt;ST2&lt;/a&gt;&lt;/li&gt;
</code></pre>

<p>效果图：</p>

<p><img src="http://cdn.lucifr.com/uploads/cheaters_02.png" alt="Cheaters Sublime text 2" /></p>
]]></content>
      
  </entry>
  
  <entry>
    
      <title type="html"><![CDATA[以后就这样折地图了 ★]]></title>
      <link href="http://wheatpond.com/2012/02/22/miuraori.html"/>
    
    <updated>2012-02-25T22:01:00+08:00</updated>
    <id>http://lucifr.com/2012/02/25/fold-map-the-miura-ori-way</id>
      
        <content type="html"><![CDATA[<p><img src="http://ww4.sinaimg.cn/mw600/61e7be7bjw1dqevt44fpng.gif" alt="Miura ori" /></p>

<p>折叠方法<a href="http://wheatpond.com/images/miurafold.png" title="Miura-ori">见此</a>。</p>

<p>via <a href="http://wheatpond.com/2012/02/22/miuraori.html" title="The Miura-ori and how to fold it">The Miura-ori and how to fold it</a></p>
<a rel="full-article" href="http://lucifr.com/2012/02/25/fold-map-the-miura-ori-way/">∞</a>]]></content>
      
  </entry>
  
  <entry>
    
      <title type="html"><![CDATA[Wake Up Time：支持睡眠唤醒的精致 Mac 闹钟[限免中]]]></title>
      <link href="http://lucifr.com/2012/02/24/wake-up-time-a-fantastic-alarm-for-mac/"/>
    
    <updated>2012-02-24T18:05:00+08:00</updated>
    <id>http://lucifr.com/2012/02/24/wake-up-time-a-fantastic-alarm-for-mac</id>
      
        <content type="html"><![CDATA[<p><a href="http://www.rockysandstudio.com/apps/wakeuptime">Wake Up Time</a>：很精致的一个 <a href="http://lucifr.com/tags/mac">Mac</a> 平台下的闹钟软件，UI 很漂亮，就像摆在你床头的一个 LCD 闹钟。不仅长的漂亮，功能也很是实用，能用来：唤醒！</p>

<p><img src="http://cdn.lucifr.com/uploads/wake_up_time.png" alt="Wake Up Time" /></p>

<p>好吧表打我，这款闹钟软件不仅能唤醒<strong>人</strong>，也可以唤醒你的 <strong>Mac</strong>，只要在安装完软件后再多下载安装一个 <a href="http://www.rockysandstudio.com/downloads/WakeUpHelperInstaller.pkg">Helper App</a>，定好唤醒时间后按下 Sleep 按钮，你的 Mac 就进入了低能耗的睡眠状态，到了唤醒时间就会先把 Mac 叫醒，然后再把你吵起来。</p>

<p>说起来它的三种闹铃声也很有特色：分别是和 UI 很搭的 Digital、很有过渡性的森林背景音、以及相对比较大声的 Cosmic，貌似基本覆盖了三类青年啊……</p>

<p>其它特性：</p>

<ul>
<li>支持 24/12 小时时制</li>
<li>系统音量校正：响铃前调整系统音量，响铃后再调回来</li>
<li>稍后再响（Snooze）：懒床者的福利，可设置 Snooze 的间隔</li>
</ul>


<p>目前正在限时免费中，快去抢一个吧。</p>

<p><a href="http://itunes.apple.com/us/app/id495945638?mt=12" title="Mac App Store - Wake Up Time">下载 Wake Up Time</a></p>
]]></content>
      
  </entry>
  
  <entry>
    
      <title type="html"><![CDATA[Sublime Text 2 Markdown 预览插件 ★]]></title>
      <link href="https://github.com/revolunet/sublimetext-markdown-preview"/>
    
    <updated>2012-02-20T14:27:00+08:00</updated>
    <id>http://lucifr.com/2012/02/20/sublime-text-2-markdown-预览插件</id>
      
        <content type="html"><![CDATA[<p><a href="http://lucifr.com/tags/sublime-text">Sublime Text</a> 2 终于迎来了一个 <a href="http://lucifr.com/tags/markdown">Markdown</a> 预览插件：<a href="https://github.com/revolunet/sublimetext-markdown-preview" title="revolunet/sublimetext-markdown-preview - GitHub">Sublime Text 2 Markdown Preview</a>。虽然 Lucifr 试用发现这个预览插件的功能比起 <a href="http://lucifr.com/tags/textmate">TextMate</a> 的还是要差不少，但总是聊胜于无，期待能够进一步改善吧。</p>

<h3>安装方法</h3>

<ul>
<li>推荐通过 <a href="http://lucifr.com/139225/sublime-text-2-tricks-and-tips/#package_control" title="Sublime Text 2 入门及技巧 - Lucifr">Package Control</a> 来安装。</li>
<li><code>Cmd + Shift + P</code> 调出命令提示，<code>Install Package</code> -> 搜索 <code>Markdown Preview</code> 安装即可。</li>
</ul>


<h3>使用</h3>

<ul>
<li><p>直接用 <code>Cmd + Shift + P</code> 命令提示调用：</p>

<ul>
<li><p>  <code>Markdown Preview: current file in browser</code> 即可在默认浏览器中对当前 Markdown 文件进行预览。</p></li>
<li><p>  <code>Markdown Preview: current file in Sublime Text</code> 则是在 Sublime Text 2 中生成 HTML 代码。</p></li>
</ul>
</li>
<li><p>可以在 <strong>Key bindings - Users</strong> 中为其指定快捷键，如：</p>

<pre><code>  [
      { "keys": ["ctrl+alt+p"], "command": "markdown_preview", "args": { "target": "browser"} }
  ]
</code></pre></li>
<li><p>此外如果对于默认输出的 CSS 不满意，也可以自行修改 <strong>~/Library/Application Support/Sublime Text 2/Packages/Markdown Preview/markdown.css</strong></p></li>
</ul>

<a rel="full-article" href="http://lucifr.com/2012/02/20/sublime-text-2-markdown-%E9%A2%84%E8%A7%88%E6%8F%92%E4%BB%B6/">∞</a>]]></content>
      
  </entry>
  
  <entry>
    
      <title type="html"><![CDATA[Playfic：互动式文字游戏平台 ★]]></title>
      <link href="http://playfic.com/"/>
    
    <updated>2012-02-17T23:55:00+08:00</updated>
    <id>http://lucifr.com/2012/02/17/playfic-make-and-play-interactive-fiction</id>
      
        <content type="html"><![CDATA[<p>Lucifr 生得太晚，接触电脑时什么《红警》、《仙剑》已经出世，没能赶上那个文字游戏大行其道的年代，但体验了一下 <a href="http://playfic.com/">Playfic</a> 这个“文字冒险游戏”平台之后，发现这种“古老”的游戏(文学?)真的很有意思，特别是当你自己也可以创作这样一个游戏的时候。</p>

<p><a href="http://playfic.com/">Playfic</a> 最大的亮点在于每个人都可以注册一个账户然后使用 <a href="http://inform7.com/">Inform 7</a> 来创作和分享自己的“互动式小说”，这是一种易学而难精的自然语言，有详细的<a href="http://inform7.com/learn/man/index.html" title="Inform - Manuals">文档</a>和<a href="http://inform7.com/learn/man/Rallegs.html" title="Inform - Manuals">实例</a>，而且 Playfic 上<a href="http://playfic.com/explore/" title="Playfic">所有的游戏</a>都是可以查看源码的。总之，Playfic 更像是一个学习社区，让人们能从已有的游戏中获取灵感和技术来创作更棒的冒险故事。</p>
<a rel="full-article" href="http://lucifr.com/2012/02/17/playfic-make-and-play-interactive-fiction/">∞</a>]]></content>
      
  </entry>
  
  <entry>
    
      <title type="html"><![CDATA[如何激活 Clear 中的隐藏主题]]></title>
      <link href="http://lucifr.com/2012/02/15/hidden-themes-in-clear-app/"/>
    
    <updated>2012-02-15T16:08:00+08:00</updated>
    <id>http://lucifr.com/2012/02/15/hidden-themes-in-clear-app</id>
      
        <content type="html"><![CDATA[<p><a href="http://itunes.apple.com/cn/app/clear/id493136154?l=en&amp;amp;mt=8">Clear</a> 今天终于上架了，这么一个很有新意的待办事项类 app 估计很多人都会忍不住一试吧，趁着现在便宜快去入手一个吧。更多的介绍 Lucifr 这里就不多说了，网上的评测已经满坑满谷了。今天主要说说 Clear 里面的三个隐藏主题。</p>

<p>Clear 默认有 5 个主题，但实际上还有 3 个隐藏的主题 Tweetbot、Scorched、Socialite 要达成一定条件才能拿到，下面就来说说方法：</p>

<h3>正常的方法</h3>

<ul>
<li><p>Tweetbot：你的 iOS 设备上安装有 <a href="http://tweetbot.com/">Tweetbot</a> 时进入 Theme 选项中就会自动激活了。</p></li>
<li><p>Scorched：到 Follow The Team 里去 Fo 几个开发组成员就行。不必全 Fo。</p></li>
<li><p>Socialite：在一个 List 里建上较多任务（有人说是 50-100个，推荐建100个，保险），全部标记为完成（可以到列表视图然后一次性标记完成），然后向上拉清除已完成的任务，就会提示要你发个推来传播 Clear，完成后主题激活。</p></li>
</ul>


<h3>非常规手段</h3>

<p>如果觉得上面的方法太麻烦(尤其是 Socialite 的取得方法)，也可以试试非常规手段。</p>

<p>在越狱设备上，用 iFile 一类的工具编辑 <strong>/var/mobile/Applications/<Clear>/Library/Preferences/com.realmacsoftware.clear.plist</strong>（注意以上路径中 Applications 下程序文件夹名一般都是随机串码，你需要找出哪个是 Clear 本尊，可以通过修改 iFile 的设置来显示程序名，网上搜搜吧，这里也不缀述了）添加如下几行：</p>

<pre><code>&lt;key&gt;com.realmacsoftware.theme.scorched&lt;/key&gt;
&lt;true/&gt;
&lt;key&gt;com.realmacsoftware.theme.social&lt;/key&gt;
&lt;true/&gt;
&lt;key&gt;com.realmacsoftware.theme.tweetbot&lt;/key&gt;
&lt;true/&gt;
</code></pre>

<p>好了，现在再打开 Clear 看一看吧：</p>

<p><img src="http://cdn.lucifr.com/uploads/clear.jpg" alt="Clear" /></p>
]]></content>
      
  </entry>
  
  <entry>
    
      <title type="html"><![CDATA[AppleScript 脚本让 Mac 唱生日快乐歌]]></title>
      <link href="http://lucifr.com/2012/02/11/make-your-mac-sing-happy-birthday-with-applescript/"/>
    
    <updated>2012-02-11T14:30:00+08:00</updated>
    <id>http://lucifr.com/2012/02/11/make-your-mac-sing-happy-birthday-with-applescript</id>
      
        <content type="html"><![CDATA[<p>Lucifr 家中有个传统，每个家庭成员的生日都要买个蛋糕，然后全家围坐唱“祝你生日快乐”来对寿星表示祝贺（寿星本人也会像胖虎一样唱“祝我生日快乐”囧）。看来现在又多了个很 geek 的选项：让 Mac 来唱生日快乐歌。</p>

<p>方法如下：</p>

<ul>
<li>打开 <strong>AppleScript Editor.app</strong>（在“应用程序” ->“实用工具”里），粘贴以下代码：</li>
</ul>


<figure class='code'><figcaption><span>Happy Birthday Song  </span></figcaption>
 <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
</pre></td><td class='code'><pre><code class='applescript'><span class='line'><span class="k">set</span> <span class="nv">currentUser</span> <span class="k">to</span> <span class="nv">long</span> <span class="nv">user</span> <span class="na">name</span> <span class="k">of</span> <span class="p">(</span><span class="k">get</span> <span class="nb">system info</span><span class="p">)</span>
</span><span class='line'><span class="k">set</span> <span class="nv">firstName</span> <span class="k">to</span> <span class="nb">first</span> <span class="nb">word</span> <span class="k">of</span> <span class="nv">currentUser</span>
</span><span class='line'><span class="k">set</span> <span class="nv">lastName</span> <span class="k">to</span> <span class="nb">last</span> <span class="nb">word</span> <span class="k">of</span> <span class="nv">currentUser</span>
</span><span class='line'>
</span><span class='line'><span class="k">set</span> <span class="nv">noteValues</span> <span class="k">to</span> <span class="p">{</span><span class="mi">56</span><span class="p">,</span> <span class="mi">56</span><span class="p">,</span> <span class="mi">58</span><span class="p">,</span> <span class="mi">56</span><span class="p">,</span> <span class="mi">61</span><span class="p">,</span> <span class="mi">60</span><span class="p">,</span> <span class="mi">50</span><span class="p">,</span> <span class="mi">56</span><span class="p">,</span> <span class="mi">56</span><span class="p">,</span> <span class="mi">58</span><span class="p">,</span> <span class="mi">56</span><span class="p">,</span> <span class="mi">63</span><span class="p">,</span> <span class="mi">61</span><span class="p">,</span> <span class="mi">50</span><span class="p">,</span> <span class="mi">56</span><span class="p">,</span> <span class="mi">56</span><span class="p">,</span> <span class="mi">68</span><span class="p">,</span> <span class="mi">65</span><span class="p">,</span> <span class="mi">61</span><span class="p">,</span> <span class="mi">60</span><span class="p">,</span> <span class="mi">58</span><span class="p">,</span> <span class="mi">50</span><span class="p">,</span> <span class="mi">66</span><span class="p">,</span> <span class="mi">66</span><span class="p">,</span> <span class="mi">65</span><span class="p">,</span> <span class="mi">61</span><span class="p">,</span> <span class="mi">63</span><span class="p">,</span> <span class="mi">61</span><span class="p">}</span> <span class="c">-- F</span>
</span><span class='line'><span class="c">-- set noteValues to {65, 65, 67, 65, 70, 69, 60, 65, 65, 67, 65, 72, 70, 60, 65, 65, 77, 74, 70, 69, 67, 60, 75, 75, 74, 70, 72, 70} -- D</span>
</span><span class='line'><span class="c">-- set noteValues to {55, 55, 57, 55, 60, 59, 50, 55, 55, 57, 55, 62, 60, 50, 55, 55, 67, 64, 60, 59, 57, 50, 65, 65, 64, 60, 62, 60} -- E</span>
</span><span class='line'>
</span><span class='line'><span class="k">set</span> <span class="nv">syllables</span> <span class="k">to</span> <span class="p">{</span><span class="s2">&quot;hap&quot;</span><span class="p">,</span> <span class="s2">&quot;p&quot;</span><span class="p">,</span> <span class="s2">&quot;birth&quot;</span><span class="p">,</span> <span class="s2">&quot;day&quot;</span><span class="p">,</span> <span class="s2">&quot;to&quot;</span><span class="p">,</span> <span class="s2">&quot;you&quot;</span><span class="p">,</span> <span class="s2">&quot;[[slnc 500]]&quot;</span><span class="p">,</span> <span class="s2">&quot;hap&quot;</span><span class="p">,</span> <span class="s2">&quot;p&quot;</span><span class="p">,</span> <span class="s2">&quot;birth&quot;</span><span class="p">,</span> <span class="s2">&quot;day&quot;</span><span class="p">,</span> <span class="s2">&quot;to&quot;</span><span class="p">,</span> <span class="s2">&quot;you&quot;</span><span class="p">,</span> <span class="s2">&quot;[[slnc 500]]&quot;</span><span class="p">,</span> <span class="s2">&quot;hap&quot;</span><span class="p">,</span> <span class="s2">&quot;p&quot;</span><span class="p">,</span> <span class="s2">&quot;birth&quot;</span><span class="p">,</span> <span class="s2">&quot;day&quot;</span><span class="p">,</span> <span class="s2">&quot;dear&quot;</span><span class="p">,</span> <span class="nv">firstName</span><span class="p">,</span> <span class="nv">lastName</span><span class="p">,</span> <span class="s2">&quot;[[slnc 500]]&quot;</span><span class="p">,</span> <span class="s2">&quot;hap&quot;</span><span class="p">,</span> <span class="s2">&quot;p&quot;</span><span class="p">,</span> <span class="s2">&quot;birth&quot;</span><span class="p">,</span> <span class="s2">&quot;day&quot;</span><span class="p">,</span> <span class="s2">&quot;to&quot;</span><span class="p">,</span> <span class="s2">&quot;you&quot;</span><span class="p">}</span>
</span><span class='line'>
</span><span class='line'><span class="k">repeat</span> <span class="nv">with</span> <span class="nv">i</span> <span class="k">from</span> <span class="mi">1</span> <span class="k">to</span> <span class="nb">the</span> <span class="nv">length</span> <span class="k">of</span> <span class="nv">noteValues</span>
</span><span class='line'>  <span class="k">set</span> <span class="nv">thisValue</span> <span class="k">to</span> <span class="nb">item</span> <span class="nv">i</span> <span class="k">of</span> <span class="nv">noteValues</span>
</span><span class='line'>  <span class="k">set</span> <span class="nv">thisSyllable</span> <span class="k">to</span> <span class="nb">item</span> <span class="nv">i</span> <span class="k">of</span> <span class="nv">syllables</span>
</span><span class='line'>  <span class="k">if</span> <span class="nv">length</span> <span class="k">of</span> <span class="nv">thisSyllable</span> <span class="ow">is less than</span> <span class="mi">3</span> <span class="k">then</span>
</span><span class='line'>      <span class="k">set</span> <span class="nv">speakingRate</span> <span class="k">to</span> <span class="mi">220</span>
</span><span class='line'>  <span class="k">else</span>
</span><span class='line'>      <span class="k">set</span> <span class="nv">speakingRate</span> <span class="k">to</span> <span class="mi">100</span>
</span><span class='line'>  <span class="k">end</span> <span class="k">if</span>
</span><span class='line'>  <span class="nb">say</span> <span class="nv">thisSyllable</span> <span class="nv">pitch</span> <span class="nv">thisValue</span> <span class="nv">using</span> <span class="s2">&quot;Victoria&quot;</span> <span class="nv">speaking</span> <span class="na">rate</span> <span class="nv">speakingRate</span> <span class="nv">modulation</span> <span class="mi">0</span>
</span><span class='line'><span class="k">end</span> <span class="k">repeat</span>
</span></code></pre></td></tr></table></div></figure>


<ul>
<li><p>现在点一下 Run 这个按钮，你应该能听到 Mac 在用“优美的声线”在给你唱歌了。这里 <code>firstName</code> 和 <code>lastName</code> 被设置为当前用户的名和姓。当然你也可以把前三行换成下面这样来自己指定姓名：</p>

<pre><code>  set firstName to "Lucifr"
  set lastName to "Liu"
</code></pre></li>
<li><p>此外如果对这个声音不感冒，可以修改倒数第二行的 <code>Victoria</code> 来指定用别的嗓音来唱，比如 <code>Bad News</code>、<code>Bahh</code> 什么的（笑）。自己到“系统选项”->“语音”->“文本至语音”->“系统嗓音”->“自定”里去找一个吧，各种性别和国籍，相信可以满足不同的取向和需求（有些太独特的需要单独下载）。</p></li>
</ul>


<p><img src="http://cdn.lucifr.com/uploads/system_speech_voice.png" alt="System Voice" /></p>

<ul>
<li><p>修改满意之后，我们可以把这个脚本起个名字保存一下。为了能在某人生日时自动播放给她/他个惊喜，我们再打开 iCal，设置个提醒：</p>

<p>  <img src="http://cdn.lucifr.com/uploads/applescript_happy_birthday.jpg" alt="iCal Happy Birthday" /></p></li>
<li><p>收工～给你的朋友一个惊<strike>吓</strike>喜去吧～</p></li>
</ul>


<p>via <a href="http://hints.macworld.com/article.php?story=20120204172337402">Mac OS X Hints</a></p>
]]></content>
      
  </entry>
  
  <entry>
    
      <title type="html"><![CDATA[NotesTab：简洁美观的菜单栏笔记应用 ★]]></title>
      <link href="http://itunes.apple.com/cn/app/notestab/id492486856?l=en&amp;mt=12"/>
    
    <updated>2012-02-11T11:17:00+08:00</updated>
    <id>http://lucifr.com/2012/02/11/notestab</id>
      
        <content type="html"><![CDATA[<p><img src="http://cdn.lucifr.com/uploads/NotesTab.jpeg" alt="NotesTab" /></p>

<p>尽管 Lucifr 不太赞成现在太多 <a href="http://lucifr.com/tags/mac">Mac</a> 下的应用程序都往菜单栏里挤，但这个 <a href="http://www.fiplab.com">FIPLAB</a> 新发布的轻量级笔记应用还是吸引了我的眼球，不得不承认 <a href="http://itunes.apple.com/cn/app/notestab/id492486856?l=en&amp;mt=12" title="Mac App Store-NotesTab">NotesTab</a> 设计得确实很漂亮（和 Lucifr <a href="http://lucifr.com/2012/01/31/my-octopress-redesigned/" title="Octopress 主题改造 - Lucifr">现在的博客主题</a>很搭啊有木有）。虽然功能上不算丰富，很难取代 <a href="http://brettterpstra.com/code/?did=28">nvALT</a> 在 Lucifr 心中的主力笔记应用地位，但如果能加入 <a href="https://www.dropbox.com/referrals/NTgxODA4MDQ5">Dropbox</a> 同步再加强下快捷键支持的话应该会有不错的前景。</p>

<p><a href="http://itunes.apple.com/cn/app/notestab/id492486856?l=en&amp;mt=12" title="Mac App Store-NotesTab">NotesTab</a> 目前正限免，手快有手慢无，抓紧。</p>
<a rel="full-article" href="http://lucifr.com/2012/02/11/notestab/">∞</a>]]></content>
      
  </entry>
  
  <entry>
    
      <title type="html"><![CDATA[ContactPrivacy：防止 App 不经允许访问地址簿]]></title>
      <link href="http://lucifr.com/2012/02/09/keep-apps-like-path-from-accessing-your-contacts-data/"/>
    
    <updated>2012-02-09T18:34:00+08:00</updated>
    <id>http://lucifr.com/2012/02/09/keep-apps-like-path-from-accessing-your-contacts-data</id>
      
        <content type="html"><![CDATA[<p>Path 不经用户允许上传地址簿的事情这两天闹的沸沸扬扬，而实际上<a href="http://www.36kr.com/p/81776.html">这么干的公司不止这一家</a>，从根儿上来说这事苹果公司脱不了干系，iOS 系统中地理位置、相册都保护的很好，唯独对地址簿不加保护，你的联系人信息可能现在就躺在不少公司的服务器里呢。</p>

<blockquote><p>我对 15 个流行的 iOS 应用开发者做了简单的调查，其中 13 个告诉我他们有联系人数据库，里面保存了大量用户地址簿信息。其中一家公司的数据库中有扎克伯格的手机号、Larry Ellison 的家里座机号以及比尔盖茨的手机号码。</p><footer><strong>Dustin Crutis</strong> <cite><a href='http://dcurt.is/stealing-your-address-book'>Stealing Your Address Book</a></cite></footer></blockquote>


<p>在苹果对这个“漏洞”做出修补之前（会有修补么？我怀疑……），已经越狱的 iOS 设备持有者可以安装 <strong>ContactPrivacy</strong> 这个补丁，会在第三方软件试图访问地址簿时给出提示，让你选择是否允许其访问。</p>

<p><img src="http://cdn.lucifr.com/uploads/contactprivacy.jpeg" alt="ContactPrivacy" /></p>

<p>要安装这个补丁，<strike>请在 Cydia 中添加 <code>http://rpetri.ch/repo</code> 这个源</strike>(已经添加进 BigBoss 源)，查找 <code>ContactPrivacy</code> 并安装即可。这个补丁没有界面或图标，只会在有程序试图访问你的地址簿时做出警告。</p>

<p><strong>注意某些程序在被禁止访问地址簿后可能会无法正常工作</strong>。</p>

<p>via <a href="http://www.cultofmac.com/145112/how-to-keep-apps-like-path-from-accessing-your-contacts-data-jailbreak/">Cult of Mac</a></p>
]]></content>
      
  </entry>
  
  <entry>
    
      <title type="html"><![CDATA[TextExpander 限时半价优惠[推介链接] ★]]></title>
      <link href="http://www.mightydeals.com/deal/textexpander.html?refID=9d2c0d"/>
    
    <updated>2012-02-08T22:56:00+08:00</updated>
    <id>http://lucifr.com/2012/02/08/textexpander-50percent-off</id>
      
        <content type="html"><![CDATA[<p>TextExpander 应该是 Mac 下最好用的输入加强工具了，现在正在进行优惠活动，50% 的折扣，原价近 $35，现在只要 $17 (记忆中似乎没这么便宜过)。如果经常重复输入同样的文字片段的话（比如程序猿），这种软件应该是必备品，能节省不少重复劳动，虽然也有其它的选择，但试来试去就 TextExpander 功能最强大也最稳定，<a href="http://www.mightydeals.com/deal/textexpander.html?refID=9d2c0d" title="Type faster with TextExpander for Mac - only $17! - MightyDeals">需要的尽快吧</a>。</p>

<blockquote><p>  <a href="#update-20120209102109" title="2012-02-09 10:21:09">更新</a>：在 Coupon Code 中输入 <code>textex10</code>，可以再减 $1.70 !</p></blockquote>
<a rel="full-article" href="http://lucifr.com/2012/02/08/textexpander-50percent-off/">∞</a>]]></content>
      
  </entry>
  
  <entry>
    
      <title type="html"><![CDATA[Sublime Text 2 右键菜单中的实用选项]]></title>
      <link href="http://lucifr.com/2012/02/08/useful-entries-in-sublime-text-2-context-menu/"/>
    
    <updated>2012-02-08T08:27:00+08:00</updated>
    <id>http://lucifr.com/2012/02/08/useful-entries-in-sublime-text-2-context-menu</id>
      
        <content type="html"><![CDATA[<p><a href="http://lucifr.com/tags/sublime-text">Sublime Text</a> 2 现在已经成了 Lucifr 最常用的编辑工具了，频繁的更新不停给人带来惊喜，今天无意中发现在右键菜单（Context menu）中有几个很实用的功能。</p>

<h3>右键菜单中的实用功能</h3>

<p><img src="http://cdn.lucifr.com/uploads/sublime_text_2_context_menu.jpg" alt="Context Menu" /></p>

<ul>
<li><p><code>Show Unsaved Changes...</code>： 显示当前文件未保存的更改，而且是以 diff 的形式在输出中显示的，一目了然。</p>

<p>  <img src="http://cdn.lucifr.com/uploads/show_unsaved_changes.jpg" alt="Show Unsaved Changes" /></p></li>
<li><p><code>Reveal in Finder</code>： 顾名思义，方便在文件系统中定位。</p></li>
<li><p><code>Copy File Path</code>：复制文件的路径，很实用的功能，比如要到终端中对当前文件进行某些操作的情况。</p></li>
<li><p><code>Reveal in Side Bar</code>：在侧边栏的目录树中定位当前文件，同样是非常实用的功能，便于了解当前文件在项目中的位置和整体结构的关系。</p></li>
</ul>


<h3>侧边栏右键功能加强</h3>

<p>推荐通过 <a href="http://lucifr.com/139225/sublime-text-2-tricks-and-tips/#package_control" title="Sublime Text 2 入门及技巧 - Lucifr">Package Control</a> 安装 <a href="https://github.com/titoBouzout/SideBarEnhancements" title="titoBouzout/SideBarEnhancements - GitHub">SideBarEnhancements</a> 这个插件，可以大大加强在侧栏目录树中右键的选项：</p>

<p><img src="http://cdn.lucifr.com/uploads/sidebarenhancements.jpg" alt="SideBarEnhancements" /></p>

<ul>
<li><p>基础的一些如：新建文件/目录，编辑，打开/运行，显示，在选择中/上级目录/项目中查找，剪切，复制，粘贴，重命名，删除，刷新……</p></li>
<li><p>很实用的 <code>Open With</code>，可以通过 <code>Edit Applications</code> 来定义程序及对应的后缀类型。可参见我的设置：</p></li>
</ul>


<figure class='code'><figcaption><span>Side Bar.sublime-menu  </span></figcaption>
 <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
<span class='line-number'>21</span>
<span class='line-number'>22</span>
<span class='line-number'>23</span>
<span class='line-number'>24</span>
<span class='line-number'>25</span>
<span class='line-number'>26</span>
<span class='line-number'>27</span>
<span class='line-number'>28</span>
<span class='line-number'>29</span>
<span class='line-number'>30</span>
<span class='line-number'>31</span>
<span class='line-number'>32</span>
<span class='line-number'>33</span>
<span class='line-number'>34</span>
<span class='line-number'>35</span>
<span class='line-number'>36</span>
<span class='line-number'>37</span>
<span class='line-number'>38</span>
<span class='line-number'>39</span>
<span class='line-number'>40</span>
<span class='line-number'>41</span>
<span class='line-number'>42</span>
<span class='line-number'>43</span>
<span class='line-number'>44</span>
<span class='line-number'>45</span>
<span class='line-number'>46</span>
<span class='line-number'>47</span>
<span class='line-number'>48</span>
<span class='line-number'>49</span>
<span class='line-number'>50</span>
<span class='line-number'>51</span>
<span class='line-number'>52</span>
<span class='line-number'>53</span>
<span class='line-number'>54</span>
<span class='line-number'>55</span>
<span class='line-number'>56</span>
<span class='line-number'>57</span>
<span class='line-number'>58</span>
<span class='line-number'>59</span>
<span class='line-number'>60</span>
<span class='line-number'>61</span>
<span class='line-number'>62</span>
<span class='line-number'>63</span>
<span class='line-number'>64</span>
<span class='line-number'>65</span>
<span class='line-number'>66</span>
<span class='line-number'>67</span>
<span class='line-number'>68</span>
<span class='line-number'>69</span>
<span class='line-number'>70</span>
<span class='line-number'>71</span>
<span class='line-number'>72</span>
<span class='line-number'>73</span>
<span class='line-number'>74</span>
<span class='line-number'>75</span>
<span class='line-number'>76</span>
<span class='line-number'>77</span>
<span class='line-number'>78</span>
<span class='line-number'>79</span>
<span class='line-number'>80</span>
<span class='line-number'>81</span>
<span class='line-number'>82</span>
</pre></td><td class='code'><pre><code class='js'><span class='line'><span class="p">[</span>
</span><span class='line'>  <span class="p">{</span><span class="s2">&quot;id&quot;</span><span class="o">:</span> <span class="s2">&quot;side-bar-files-open-with&quot;</span><span class="p">,</span>
</span><span class='line'>      <span class="s2">&quot;children&quot;</span><span class="o">:</span>
</span><span class='line'>      <span class="p">[</span>
</span><span class='line'>
</span><span class='line'>          <span class="c1">// Marked</span>
</span><span class='line'>            <span class="p">{</span>
</span><span class='line'>                <span class="s2">&quot;caption&quot;</span><span class="o">:</span> <span class="s2">&quot;Marked&quot;</span><span class="p">,</span>
</span><span class='line'>                <span class="s2">&quot;id&quot;</span><span class="o">:</span> <span class="s2">&quot;side-bar-files-open-with-marked&quot;</span><span class="p">,</span>
</span><span class='line'>                <span class="s2">&quot;command&quot;</span><span class="o">:</span> <span class="s2">&quot;side_bar_files_open_with&quot;</span><span class="p">,</span>
</span><span class='line'>                <span class="s2">&quot;args&quot;</span><span class="o">:</span> <span class="p">{</span>
</span><span class='line'>                                    <span class="s2">&quot;paths&quot;</span><span class="o">:</span> <span class="p">[],</span>
</span><span class='line'>                                    <span class="s2">&quot;application&quot;</span><span class="o">:</span> <span class="s2">&quot;Marked.app&quot;</span><span class="p">,</span>
</span><span class='line'>                                    <span class="s2">&quot;extensions&quot;</span><span class="o">:</span><span class="s2">&quot;markdown|md|mdown|mkd|mkdn|txt&quot;</span>  <span class="c1">//any file with these extensions</span>
</span><span class='line'>                                <span class="p">}</span>
</span><span class='line'>            <span class="p">},</span>
</span><span class='line'>            <span class="p">{</span><span class="s2">&quot;caption&quot;</span><span class="o">:</span><span class="s2">&quot;-&quot;</span><span class="p">},</span>
</span><span class='line'>          <span class="c1">//Photoshop</span>
</span><span class='line'>          <span class="p">{</span>
</span><span class='line'>              <span class="s2">&quot;caption&quot;</span><span class="o">:</span> <span class="s2">&quot;Photoshop&quot;</span><span class="p">,</span>
</span><span class='line'>              <span class="s2">&quot;id&quot;</span><span class="o">:</span> <span class="s2">&quot;side-bar-files-open-with-photoshop&quot;</span><span class="p">,</span>
</span><span class='line'>
</span><span class='line'>              <span class="s2">&quot;command&quot;</span><span class="o">:</span> <span class="s2">&quot;side_bar_files_open_with&quot;</span><span class="p">,</span>
</span><span class='line'>              <span class="s2">&quot;args&quot;</span><span class="o">:</span> <span class="p">{</span>
</span><span class='line'>                                  <span class="s2">&quot;paths&quot;</span><span class="o">:</span> <span class="p">[],</span>
</span><span class='line'>                                  <span class="s2">&quot;application&quot;</span><span class="o">:</span> <span class="s2">&quot;Adobe Photoshop CS5.app&quot;</span><span class="p">,</span>
</span><span class='line'>                                  <span class="s2">&quot;extensions&quot;</span><span class="o">:</span><span class="s2">&quot;psd|png|jpg|jpeg&quot;</span>  <span class="c1">//any file with these extensions</span>
</span><span class='line'>                              <span class="p">}</span>
</span><span class='line'>          <span class="p">},</span>
</span><span class='line'>          <span class="c1">// Preview</span>
</span><span class='line'>            <span class="p">{</span>
</span><span class='line'>                <span class="s2">&quot;caption&quot;</span><span class="o">:</span> <span class="s2">&quot;Preview&quot;</span><span class="p">,</span>
</span><span class='line'>                <span class="s2">&quot;id&quot;</span><span class="o">:</span> <span class="s2">&quot;side-bar-files-open-with-preview&quot;</span><span class="p">,</span>
</span><span class='line'>                <span class="s2">&quot;command&quot;</span><span class="o">:</span> <span class="s2">&quot;side_bar_files_open_with&quot;</span><span class="p">,</span>
</span><span class='line'>                <span class="s2">&quot;args&quot;</span><span class="o">:</span> <span class="p">{</span>
</span><span class='line'>                                    <span class="s2">&quot;paths&quot;</span><span class="o">:</span> <span class="p">[],</span>
</span><span class='line'>                                    <span class="s2">&quot;application&quot;</span><span class="o">:</span> <span class="s2">&quot;Preview.app&quot;</span><span class="p">,</span>
</span><span class='line'>                                    <span class="s2">&quot;extensions&quot;</span><span class="o">:</span><span class="s2">&quot;psd|png|jpg|jpeg|gif&quot;</span>  <span class="c1">//any file with these extensions</span>
</span><span class='line'>                                <span class="p">}</span>
</span><span class='line'>            <span class="p">},</span>
</span><span class='line'>          <span class="c1">//separator</span>
</span><span class='line'>          <span class="p">{</span><span class="s2">&quot;caption&quot;</span><span class="o">:</span><span class="s2">&quot;-&quot;</span><span class="p">},</span>
</span><span class='line'>          <span class="c1">//Browsers</span>
</span><span class='line'>          <span class="p">{</span>
</span><span class='line'>              <span class="s2">&quot;caption&quot;</span><span class="o">:</span> <span class="s2">&quot;Chrome&quot;</span><span class="p">,</span>
</span><span class='line'>              <span class="s2">&quot;id&quot;</span><span class="o">:</span> <span class="s2">&quot;side-bar-files-open-with-chrome&quot;</span><span class="p">,</span>
</span><span class='line'>
</span><span class='line'>              <span class="s2">&quot;command&quot;</span><span class="o">:</span> <span class="s2">&quot;side_bar_files_open_with&quot;</span><span class="p">,</span>
</span><span class='line'>              <span class="s2">&quot;args&quot;</span><span class="o">:</span> <span class="p">{</span>
</span><span class='line'>                                  <span class="s2">&quot;paths&quot;</span><span class="o">:</span> <span class="p">[],</span>
</span><span class='line'>                                  <span class="s2">&quot;application&quot;</span><span class="o">:</span> <span class="s2">&quot;Google Chrome.app&quot;</span><span class="p">,</span>
</span><span class='line'>                                  <span class="s2">&quot;extensions&quot;</span><span class="o">:</span><span class="s2">&quot;html|php&quot;</span> <span class="c1">//any file with extension</span>
</span><span class='line'>                              <span class="p">}</span>
</span><span class='line'>          <span class="p">},</span>
</span><span class='line'>
</span><span class='line'>          <span class="p">{</span>
</span><span class='line'>                <span class="s2">&quot;caption&quot;</span><span class="o">:</span> <span class="s2">&quot;Firefox&quot;</span><span class="p">,</span>
</span><span class='line'>                <span class="s2">&quot;id&quot;</span><span class="o">:</span> <span class="s2">&quot;side-bar-files-open-with-firefox&quot;</span><span class="p">,</span>
</span><span class='line'>                <span class="s2">&quot;command&quot;</span><span class="o">:</span> <span class="s2">&quot;side_bar_files_open_with&quot;</span><span class="p">,</span>
</span><span class='line'>                <span class="s2">&quot;args&quot;</span><span class="o">:</span> <span class="p">{</span>
</span><span class='line'>                                    <span class="s2">&quot;paths&quot;</span><span class="o">:</span> <span class="p">[],</span>
</span><span class='line'>                                    <span class="s2">&quot;application&quot;</span><span class="o">:</span> <span class="s2">&quot;Firefox.app&quot;</span><span class="p">,</span>
</span><span class='line'>                                    <span class="s2">&quot;extensions&quot;</span><span class="o">:</span><span class="s2">&quot;html|php&quot;</span>  <span class="c1">//any file with these extensions</span>
</span><span class='line'>                                <span class="p">}</span>
</span><span class='line'>            <span class="p">},</span>
</span><span class='line'>
</span><span class='line'>          <span class="p">{</span><span class="s2">&quot;caption&quot;</span><span class="o">:</span><span class="s2">&quot;-&quot;</span><span class="p">},</span>
</span><span class='line'>           <span class="c1">// Textmate</span>
</span><span class='line'>            <span class="p">{</span>
</span><span class='line'>                <span class="s2">&quot;caption&quot;</span><span class="o">:</span> <span class="s2">&quot;Textmate&quot;</span><span class="p">,</span>
</span><span class='line'>                <span class="s2">&quot;id&quot;</span><span class="o">:</span> <span class="s2">&quot;side-bar-files-open-with-textmate&quot;</span><span class="p">,</span>
</span><span class='line'>                <span class="s2">&quot;command&quot;</span><span class="o">:</span> <span class="s2">&quot;side_bar_files_open_with&quot;</span><span class="p">,</span>
</span><span class='line'>                <span class="s2">&quot;args&quot;</span><span class="o">:</span> <span class="p">{</span>
</span><span class='line'>                                    <span class="s2">&quot;paths&quot;</span><span class="o">:</span> <span class="p">[],</span>
</span><span class='line'>                                    <span class="s2">&quot;application&quot;</span><span class="o">:</span> <span class="s2">&quot;Textmate 2.app&quot;</span><span class="p">,</span>
</span><span class='line'>                                    <span class="s2">&quot;extensions&quot;</span><span class="o">:</span><span class="s2">&quot;.*&quot;</span>  <span class="c1">//any file with these extensions</span>
</span><span class='line'>                                <span class="p">}</span>
</span><span class='line'>            <span class="p">}</span>
</span><span class='line'>
</span><span class='line'>      <span class="p">]</span>
</span><span class='line'>  <span class="p">}</span>
</span><span class='line'><span class="p">]</span>
</span></code></pre></td></tr></table></div></figure>


<ul>
<li>很牛的 <code>Copy as Text...</code>：包含各种形式的路径、URI（甚至包括 base64 的 data:uri）、转码后的文件名、各种 HTML Tag（a、img、script、style）……</li>
</ul>


<p>欢迎关注 <a href="http://lucifr.com/tags/sublime-text">Sublime Text</a> 这个标签，Lucifr 会继续分享更多相关的技巧和信息。</p>
]]></content>
      
  </entry>
  
  <entry>
    
      <title type="html"><![CDATA[Dropzone 2.0]]></title>
      <link href="http://lucifr.com/2012/02/07/dropzone-2_0/"/>
    
    <updated>2012-02-07T16:51:00+08:00</updated>
    <id>http://lucifr.com/2012/02/07/dropzone-2_0</id>
      
        <content type="html"><![CDATA[<p>Lucifr 觉着，Mac 让人用着比较舒适的一个重要原因之一就是各种拖放动作，比如拖放文件到文件夹上、到 Dock 的程序上、到“打开文件”对话框的窗口里、到 Mission Control 界面的不同窗口或是 Space 里……</p>

<p><a href="http://aptonic.com/dropzone2/" title="Introducing Dropzone 2">Dropzone</a> 这个应用程序就是将功能集中在拖放这个动作上，通过扩展来实现不同的功能，使得很多本来需要多个步骤才能完成的工作在一个拖放之中完成。</p>

<p><img src="http://cdn.lucifr.com/uploads/dropzone.jpg" alt="Dropzone" /></p>

<p>比如你可以添加应用程序到 Dropzone 中，拖文件到相应的程序图标上就会用对应的程序来打开（这实际上相当于把 Dropzone 当成是个快捷程序启动区域了，避免 Dock 上堆积太多图标），再比如压缩个文件、分享个照片、生成个短链接、换换壁纸啥的，也都是比较能常用到功能。</p>

<p>Lucifr 最喜欢的是 FTP/SCP Upload，能将拖放的文件上传到设置好的服务器目录中并将链接复制到剪贴板里，在博客里贴图片非常方便。</p>

<p>但对于大多数人来说，Dropzone 那有限的几个插件可能真的很难入眼，所以这东西还是落在懂编程的人手里会更得心应手一些，缺啥插件<a href="http://aptonic.com/dropzone/documentation/" title="Aptonic Software - Dropzone Scripting API">自己写</a>。比如<a href="http://lucifr.com/2012/02/06/gather-a-markdownifier-for-mac/" title="Gather: 抓取网页并转为 Markdown 格式 - Lucifr">上一篇文章</a>中提到过的 <a href="http://brettterpstra.com/" title="Welcome to BrettTerpstra.com, home of Brett Terpstra and his nerdery">Brett</a>，就贡献了好几个不错的插件：比如 Clipboard Links to Markdown，可以将拖放的链接变成 Markdown 引用格式，写博客时非常实用。</p>

<blockquote><p>  官方的<a href="http://aptonic.com/extend.php" title="Aptonic Software - Dropzone">扩展页面</a>中只列出了有限的几个扩展，实际上你能<a href="https://github.com/aptonic/dropzone-user-scripts" title="aptonic/dropzone-user-scripts - GitHub">在 Github 中找到更多</a>。</p></blockquote>

<p>说了这么多，好像有点跑题了，今天的主题本来是 Dropzone 2.0 的啊汗……</p>

<p>言归正传，2.0 版本最惹眼的可能就是 Circle 功能了，程序的作者是<a href="http://www.youtube.com/watch?v=0bMvnsM-D_s" title="Path/Circles Demo - YouTube">受到了 Path 的启发</a>而添加了这个功能，拖起文件后移动到屏幕右方，Circles 就会被激活，确实比拖到菜单栏的小图标上要方便的多，效果也很炫，可以到官方网站上<a href="http://aptonic.com/dropzone2/" title="Introducing Dropzone 2">体验一下</a>。</p>

<p><img src="http://cdn.lucifr.com/uploads/dropzone_circles.jpg" alt="Dropzone Circles" /></p>

<p>不过 Lucifr 发现目前<strong>最多只能添加 4 个 Circles</strong>，这完全不够嘛，希望之后的版本里能允许加入更多吧。</p>

<p>看到这里如果你感到心动，有购买 Dropzone 的意愿，2月8日之前最好动手，<a href="http://itunes.apple.com/cn/app/dropzone/id464733615?l=en&amp;mt=12" title="Mac App Store-Dropzone">有 7 折优惠</a>。</p>
]]></content>
      
  </entry>
  
  <entry>
    
      <title type="html"><![CDATA[Gather: 抓取网页并转为 Markdown 格式 ★]]></title>
      <link href="http://brettterpstra.com/introducing-gather-a-cocoa-markdownifier/"/>
    
    <updated>2012-02-06T11:06:00+08:00</updated>
    <id>http://lucifr.com/2012/02/06/gather-a-markdownifier-for-mac</id>
      
        <content type="html"><![CDATA[<p>如果你和 Lucifr 一样经常在 Mac 下使用 <a href="http://lucifr.com/tags/markdown">Markdown</a> 来写东西，那么你一定或多或少的听过 <a href="http://brettterpstra.com/">Brett Terpstra</a> 的大名。他不仅是 <a href="http://markedapp.com/">Marked</a> 和 <a href="http://brettterpstra.com/code/?did=28">nvAlt</a> 的作者，同时也经常在他的博客上提供<a href="http://brettterpstra.com/tag/markdown/">大量 Markdown 的相关工具和技巧</a>。这次他又为 Markdown 和 Mac 使用者带来了一个很实用的小工具：<a href="http://brettterpstra.com/introducing-gather-a-cocoa-markdownifier/">Gather</a>。</p>

<p><img src="http://cdn.lucifr.com/uploads/gather.png" alt="Gather" /></p>

<p>向 Gather 中输入一个网址，Gather 就会自动抓取这个网页中的主要内容并将其转为 Markdown 格式，同时还有选项可以将转换后的内容自动加入到剪贴板中，以方便粘贴到其它应用程序中，这对于使用 Markdown 格式做笔记收集的人来说真的很方便。</p>

<p>需要提醒的是目前 Gather 只支持 Lion 以上 Mac 系统。虽然目前第一版的功能还比较简单，但 Brett Terpstra 显然对这个程序有更长远的打算，让我们拭目以待吧。</p>
<a rel="full-article" href="http://lucifr.com/2012/02/06/gather-a-markdownifier-for-mac/">∞</a>]]></content>
      
  </entry>
  
  <entry>
    
      <title type="html"><![CDATA[Slash：Octopress 极简主题 ★]]></title>
      <link href="http://zespia.tw/Octopress-Theme-Slash/index_tw.html"/>
    
    <updated>2012-02-05T23:28:00+08:00</updated>
    <id>http://lucifr.com/2012/02/05/slash-theme-for-octopress</id>
      
        <content type="html"><![CDATA[<p>来自台湾的 @<a href="http://twitter.com/tommy351" title="tommy351">tommy351</a> 专门为 <a href="http://lucifr.com/tags/octopress">Octopress</a> 创作的简约风格主题 <a href="http://zespia.tw/Octopress-Theme-Slash/index_tw.html" title="Slash &mdash; 專為 Octopress 設計的極簡主題">Slash</a>。这应该是目前第一款独立发布可安装的 Octopress 主题了。</p>

<p><img src="http://cdn.lucifr.com/uploads/slash_octopress_theme.jpeg" alt="Slash theme for octopress" /></p>

<p>Slash 设计风格上非常简约，但 @<a href="http://twitter.com/tommy351" title="tommy351">tommy351</a> 还是细心的加入了很多实用的功能：</p>

<ul>
<li>自动读取图片的 <code>alt</code> 属性，并在图片下方显示注解。</li>
<li>内建 <a href="http://fancyapps.com/fancybox/">Fancybox</a>，让您轻松展示您的作品。</li>
<li>自动将 HTML5 <code>video</code>、<code>iframe</code>、<code>object</code> 等嵌入式影片缩放至页面宽度。</li>
<li>支援 responsive layouts，无论电脑、手机、平板都能获得极佳的使用体验。</li>
<li><a href="http://zespia.tw/Octopress-Theme-Slash/index_tw.html">更多介绍</a>…</li>
</ul>


<h3>主题安装方法：</h3>

<p>在终端中运行以下命令就能完成主题安装：</p>

<pre><code>$ cd octopress
$ git clone git@github.com:tommy351/Octopress-Theme-Slash.git .themes/slash
$ rake install['slash']
$ rake generate
</code></pre>

<p>如果你喜欢这个主题，别忘了去作者的<a href="http://zespia.tw/blog/2012/01/25/slash-theme/" title="Slash — 專為 Octopress 設計的極簡主題 - Zespia">发布页面</a>去表达下支持。</p>
<a rel="full-article" href="http://lucifr.com/2012/02/05/slash-theme-for-octopress/">∞</a>]]></content>
      
  </entry>
  
  <entry>
    
      <title type="html"><![CDATA[Octopress 博客列表 ★]]></title>
      <link href="https://github.com/imathis/octopress/wiki/Octopress-Sites"/>
    
    <updated>2012-02-05T16:52:00+08:00</updated>
    <id>http://lucifr.com/2012/02/05/list-of-octopress-blogs</id>
      
        <content type="html"><![CDATA[<p>本来想整理一个使用 <a href="http://lucifr.com/tags/octopress">Octopress</a> 的博客列表，发现 Octopress 官方 repo 的 Wiki 当中已经有一个<a href="https://github.com/imathis/octopress/wiki/Octopress-Sites">收集页面</a>了。不过这个页面弄得这么隐蔽估计都没什么人注意到，帮助宣传一下，希望有更多中文用户加入到其中吧～</p>
<a rel="full-article" href="http://lucifr.com/2012/02/05/list-of-octopress-blogs/">∞</a>]]></content>
      
  </entry>
  
  <entry>
    
      <title type="html"><![CDATA[Octopress 推特挂件大局域网内显示问题]]></title>
      <link href="http://lucifr.com/2012/02/03/twitter-widget-inside-great-firewall-on-octopress-blog/"/>
    
    <updated>2012-02-03T15:56:00+08:00</updated>
    <id>http://lucifr.com/2012/02/03/twitter-widget-inside-great-firewall-on-octopress-blog</id>
      
        <content type="html"><![CDATA[<p>Twitter 挂件估计很多 Octopressor 都在用，但由于它直接调用的 Twitter Api，又不像以前的 Wordpress 一样有带缓存的插件，在天朝的大局域网内对一般青年来说只能看到个鸟，经过 Lucifr 的摸索，现在折腾了一个方法，目前至少让 timeline 显示了出来。</p>

<!-- more -->


<p>具体方法如下：</p>

<ol>
<li><p>首先是要在一台境外服务器上搭建 twip，这个具体就不详述了，参照 @<a href="http://twitter.com/yegle">yegle</a> 的<a href="https://github.com/yegle/twip/wiki/twip-User-Guide" title="twip User Guide - GitHub">指导</a>或是网上他人的教程即可。</p></li>
<li><p>确定你搭建的 twip 的 T 模式的地址，如果 twip 的地址是 <code>http://example.com/twip/</code>，那么 T-mode 的地址就是 <code>http://example.com/twip/t/</code>。</p></li>
<li><p>打开 <code>Octopress/source/javascripts/twitter.js</code>，在其中 73 行可以找到</p>

<pre><code>url: "http://api.twitter.com/1/statuses/user_timeline/" + user + ".json?trim_user=true&amp;count=...
</code></pre>

<p>用以上的 T 模式地址替换掉 Twitter 的 api，也就是这样</p>

<pre><code>url: "http://example.com/twip/t/statuses/...
</code></pre></li>
<li><p>如果 twip 运转正常，那么这时生成的网站就应该可以显示出 timeline 了。但有一个小问题，就是别人也可以利用你搭建的这个 twip 来制作挂件或是访问那个不存在的网站，这样一来流量不保就麻烦了(当然你要造福人民我也不拦着）。</p>

<p><a href="https://github.com/yegle/twip/issues/1" title="#1: Is there a way to set a user limit as in older versions? - Issues - yegle/twip - GitHub">请教过 @yegle</a> 后 Lucifr 又对 nginx 的 rewrite 规则进行了修改：</p>

<pre><code>location / {
    if (!-e $request_filename){
        rewrite ^/twip/t/statuses/user_timeline/你的 Twitter 用户名.json(.*)$ /twip/index.php last;
        }
    }
</code></pre>

<p>这样一来这个 twip 就只有在获取你自己的 Timeline 时才能使用了（同时也可以删掉 oauth.php 来关掉 O 模式）。</p></li>
</ol>

]]></content>
      
  </entry>
  
</feed>

