This file contains hidden or 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
/* Vars */ | |
@font-size: 16px; | |
@vertical-rhythm: @font-size * 1.5; | |
@fontstack1: sans-serif; /* Headings */ | |
@fontstack2: Georgia, serif; /* Body copy */ | |
@color1: #20bd7c; /* Main theme colour colour */ | |
@color2: #333; /* headings */ |
This file contains hidden or 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
使用 Git 與 Git Hooks 同步 MySQL 資料庫 | |
===================================== | |
參考來源: [Synchronizing a MySQL Database with Git and Git Hooks](http://ben.kulbertis.org/2011/10/synchronizing-a-mysql-database-with-git-and-git-hooks/) | |
目前採用的方法,也是利用 Git Hooks,基本有兩個: | |
1. push-db:將本地異動推到遠端前運行,讓本地資料庫 => 遠端資料庫(pre-push)。 | |
2. pull-db:將遠端異動拉回本地後運行,讓遠端資料庫 => 本地資料庫(post-update)。 |
This file contains hidden or 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
// # Ghost Configuration | |
// Setup your Ghost install for various environments | |
// Documentation can be found at http://docs.ghost.org/usage/configuration/ | |
var path = require('path'), | |
config; | |
config = { | |
// ### Development **(default)** | |
development: { |
This file contains hidden or 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
#!/bin/sh | |
# | |
# 這個範例 | |
# An example hook script to update the working tree, including its | |
# submodules, after receiving a push. | |
# | |
# This hook requires core.worktree to be explicitly set, and | |
# receive.denyCurrentBranch to be set to false. | |
# | |
# To enable this hook, rename this file to "post-receive". |
This file contains hidden or 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> | |
<head> | |
<script type="text/javascript"> | |
var gCanvas; | |
var gCtx; | |
function load(){ | |
console.log("loaded"); | |
gCanvas = document.getElementById("mcanvas"); | |
if (gCanvas.getContext){ |
This file contains hidden or 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
tell application "FoldingText" | |
tell front document | |
evaluate script "function(editor, options) { | |
var tree = editor.tree(), | |
headings = tree.evaluateNodePath('//heading'), | |
toc = []; | |
headings.forEach(function(each) { | |
var level = each.typeIndentLevel(), | |
text = '- ' + each.text(); |
This file contains hidden or 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
使用 Asciidoc,測試整合 Hipchat | |
=== HTMLBook | |
HTMLBook 是一個開放專案,使用 XHTML5 為基礎,目的是用來撰寫與生產書籍,包含紙本與電子書。它根據下面的前提而開發: | |
* 書本質上沒有時間性(不包含流通與能見度)。書的基本架構,數百年來均穩定不變,也將持續下去,不管以紙本或數位格式呈現。 | |
* 在可見的未來,HTML 都會是世界通用的標記語言格式。 | |
* 在可見的未來,單一文件來源的生產流程,價值日益提高。 |
This file contains hidden or 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
安裝 Nginx, PHP-FPM, MySQL and phpMyAdmin on OS X Mavericks using Homebrew | |
Recently got a new MacBook Pro and decided to set it up from scratch, because I use the same Time Machine backup to migrate from since about four years. Perfect time to get rid of the web server/LAMP (Linux Apache MySQL PHP) stack and replace it with Nginx and PHP-FPM as FastCGI implementation. Below you can read how to setup Nginx, PHP-FPM, MySQL and PhpMyAdmin on OS X 10.9 / Mavericks. | |
Xcode | |
First of all, get the latest Xcode version via the Mac App Store: | |
Download Xcode.app (via Mac App Store) |
This file contains hidden or 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
server { | |
listen 80; | |
server_name asami.local; | |
root /Users/wastemobile/site/asami; | |
index index.php index.html index.htm; | |
charset UTF-8; | |
location ~ /\.ht { | |
deny all; | |
} |
This file contains hidden or 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
/** | |
* Converts an SVG element to an IMG element with the same dimensions | |
* and same visual content. The IMG src will be a base64-encoded image. | |
* Works in Webkit and Firefox (not IE). | |
*/ | |
$.fn.toImage = function() { | |
$(this).each(function() { | |
var svg$ = $(this); | |
var width = svg$.width(); | |
var height = svg$.height(); |