Skip to content

Instantly share code, notes, and snippets.

View wastemobile's full-sized avatar

wastemobile wastemobile

View GitHub Profile
@wastemobile
wastemobile / Laravel
Last active March 10, 2016 09:18
在 Mac 上搭配 MAMP 使用 PHP Composer and Laravel
# 在 Mac 上使用 MAMP, PHP Composer and Laravel
在個人目錄 `~/` 下已建立了 `bin` 目錄,並加入執行路徑中。
前往 `bin` 目錄運行下列指令,會安裝一個 `composer.phar` 檔案。(升級時重複運行這行即可。)
`curl -sS https://getcomposer.org/installer | php`
編輯 `~/.bash_profile` 檔案:
@wastemobile
wastemobile / flatui
Created September 6, 2014 09:10
Flat UI Colors
// Flat UI Colors
$turquoise : #1ABC9C;
$emerald : #2ECC71;
$peter-river : #3498DB;
$amethyst : #9B59B6;
$wet-asphalt : #34495E;
$green-sea : #16A085;
$nephritis : #27AE60;
$belize-hole : #2980B9;
$wisteria : #8E44AD;
@wastemobile
wastemobile / mavericks
Last active August 29, 2015 14:06
Develop Environment Setup
## Node
安裝 nvm 管理 node 與 npm,這個程序若使用 Homebrew 安裝,就算看起來沒問題,但使用一陣子、多半是有更新時,很容易出錯,因此改採自行安裝的方法。
1. git clone https://github.com/creationix/nvm.git ~/.nvm
2. cd ~/.nvm
3. git checkout `git describe --abbrev=0 --tags`
git describe 是尋找距離目前最近的 tag,預設是找正式的標籤,加上參數 `--tags` 則連同輕量級(lightweight - non-annotated tag)也算在內;參數 `--abbrev=<n>` 是修改以七位 hexadecimal 數字的預設,當 `<n>` 等於 `0` 則會捨棄預設的長格式,只將最近的標籤拿來使用。

#Meteor and Self-hosted Infrastructure

Meteor is an eye-opening JavaScript framework that runs on both the client and the server, giving developers a revolutionary take on software engineering. If you are not familiar with Meteor, I urge you to visit their website.

##An overview

In this brief gist, I am going to discuss the process of setting up a server (in my case, a VPS) to host Meteor applications.

My experience with Meteor has been brief, however it has not taken much demonstration for me to realise the significance of this stellar framework. Let's jump right in!

@wastemobile
wastemobile / 極簡 HTML, CSS, JavaScript
Created November 16, 2014 16:02
Mac Web Servers Context
context: HTML, CSS, JavaScript
只為了測試前端:
```
python -mSimpleHTTPServer
```
@wastemobile
wastemobile / Start
Created March 2, 2015 14:32
NodeJS
## 資源
- [入門資源連結](https://cnodejs.org/getstart)
- [七天學會NodeJS](http://nqdeng.github.io/7-days-nodejs/)
- [Node.js 包膠不包會](https://github.com/alsotang/node-lessons)
- [使用 Express + MongoDB 搭建多人博客](https://github.com/nswbmw/N-blog/wiki/第1章--一个简单的博客)
@wastemobile
wastemobile / app
Created March 12, 2015 13:46
相關係數
var JOURNAL = require('./journal');
//陣列的 indexOf(name) 回傳索引或 -1(不存在)
//這個 hasEvent 用來檢測某事件是否存在
function hasEvent(event, entry) {
return entry.events.indexOf(event) != -1;
}
//將某事件與變松鼠的關係寫成 [n00, n01, n10, n11] 陣列
function tableFor(event, journal) {
var table = [0, 0, 0, 0];
#!/bin/bash
set -o errexit
# IP or URL of the server you want to deploy to
APP_HOST=example.com
# Uncomment this if your host is an EC2 instance
# EC2_PEM_FILE=path/to/your/file.pem
# You usually don't need to change anything below this line
@wastemobile
wastemobile / Pi2_OS.md
Last active August 29, 2015 14:25
Raspberry Pi 2

官方調教的是 Raspbian,Debian 的分支,目前代號Wheezy,也就是 Debian 7。

可手動升級到 Debian 8 Jessie。

首先將官方映像燒到 SD 卡,Mac 上推薦使用 ApplePi-Baker 程式。

在最簡模式,插入 Raspbian SD 卡、接上實體網路線、接上 USB 電源,系統會自動從區網 DHCP 取得網路 ip,從遠端 Mac 上以終端機 ssh 登入,執行 ssh [email protected] 預設密碼是 raspberry。

登入後先執行 sudo raspi-config,使用文字選取介面完成幾項初始工作:

#!/bin/bash
echo -e "\n移除不需要的預設套件"
meteor remove autopublish insecure
echo -e "\n安裝基礎會員帳戶套件"
meteor add accounts-password alanning:roles
echo -e "\n安裝 Flow 路由套件"
meteor add kadira:flow-router kadira:blaze-layout