Skip to content

Instantly share code, notes, and snippets.

View poying's full-sized avatar
🏠
I may be slow to respond.

Po-Ying Chen poying

🏠
I may be slow to respond.
View GitHub Profile
travel_info: [
{
id: "1713850117022697954",
title: "來自南台灣最溫暖的手作包",
file_list: [ ],
page_view: 11,
links: null,
start_at: {
date: "2013-12-09 08:30:39",
timezone_type: 3,
<app-router>
<app-route path="/" templateUrl="/index.html"></app-route>
</app-router>
@poying
poying / errors.js
Last active December 21, 2015 21:18
var errors = require('errors')('{level:x}{module:xxx}-{code:xx}');
errors.setLevel('System', '1');
errors.setLevel('Service', '2');
errors.setModule('default', '000');
errors.System.setModule('module1', '001');
errors.System.setModule('module2', '002');
<div list-input list="spot.transport" ng-init="types={a: '公車', b: '太空船'}" class="control-group">
<label class="control-label">交通方式</label>
<div class="controls">
<select ng-model="data.type" ng-options="key as val for (key, val) in types">
</select>
<input type="text" ng-model="data.detail" placeholder="123 OO站下車,右轉後直走兩分鐘, 捷運|捷運xx站n號出口出來後直走2分鐘" class="m-wrap medium">
<button type="button" class="add btn" ng-click="push()" href="#">新增</button>
<ul class="rows">
<li ng-repeat="i in list"><a ng-click="remove($index)" stop-event href="">刪除</a> || types[i.type] || - || i.detail ||</li>
</ul>
var tmp = $data;
$data = {};
tmp.split(',').forEach(function (key, val) {
$data[key] = val;
});
console.log($data.background); // output: green
var getElementsByAttribute = function (tagname, attr, value) {
if (arguments.length < 3) {
value = attr;
attr = tagname;
tagname = '*';
}
var match = [];
var eles = document.getElementsByTagName(tagname);
var i = eles.length;
while (i) {
var dateFormat = (function () {
var keywords = {
Y: 'getFullYear',
m: 'getUTCMonth',
d: 'getUTCDate',
H: 'getUTCHours',
i: 'getUTCMinutes',
s: 'getUTCSeconds',
u: 'getUTCMilliseconds'
};
# Group
group:
edit:
submit: 更新群組
show:
name: 群組名稱
new:
submit: 建立群組
flash:
updated: 群組已被更新
@poying
poying / sandston.md
Created June 21, 2013 15:47
sandston 佈景開發說明

安裝

切換到 htdocs/sandstone

npm install

Stylus 編譯 & LiveReload

./livereload
@poying
poying / express.js
Created May 13, 2013 14:50
express 多個 view folder
'use strict';
var path = require('path');
var express = require('express');
function _merge(a, b) {
if (a && b) {
var i;
for (i in b) {
if (b.hasOwnProperty(i)) {