Skip to content

Instantly share code, notes, and snippets.

@fantasywind
fantasywind / Gruntfile.js for yo angular with jade and stylus
Last active August 29, 2015 13:56
Please install contrib first: npm install grunt-contrib-jade -D;npm install grunt-contrib-stylus -D;npm install;
// Generated on 2014-02-05 using generator-angular 0.7.1
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
@fantasywind
fantasywind / requestAnimationFrame service on angular
Last active August 29, 2015 14:01
requestAnimationFrame service on angular
'use strict'
angular.module('testApp')
.service 'Frame', ->
refresher = []
refresherCleaner = []
_state = 'OFF'
@state =
{"schedule":[{"main_view":"{"viewID":114098,"name":"台灣高鐵台北站(Taipei Station)","placeCategory":"VIEW","region":"台北市中正區","longitude":121.517669678,"latitude":25.0476703644,"address":"台北市中正區北平西路3號車站 ","phone":"02-6632-5000","openTime":"sunu003d[600, 0];satu003d[600, 0];friu003d[600, 0];thuu003d[600, 0];wedu003d[600, 0];tueu003d[600, 0];monu003d[600, 0];","spendTimeMeasure":"S","averagePrice":100,"source":"http://www.ipeen.com.tw/shop/57061-台灣高鐵台北站-Taipei-Station","officialWebsite":"http://www.ipeen.com.tw/shop/57061-台灣高鐵台北站-Taipei-Station","placePopularity":516699.0,"updateTime":"2014-12-06 15:51:15.0"}","time":"MORNING","date":"2014-12-19","near_view":["{"viewID":8632,"name":"黑松世界(黑松博物館)","placeCategory":"VIEW","region":"台北市松山區","longitude":121.544830322,"latitude":25.0455036163,"address":"105台北市松山區復興南路一段39號B區2樓","phone":"(02)2752-5589","openTime":"Au003d0-24","spendTimeMeasure":"S","averagePrice":100,"source":"http://admin.taiwan.net.tw/source/source.aspx?nou003d142u0026pgu003d105","officialWebsite":"","placeP
{
"swagger": 2,
"info": {
"title": "天品時光膠囊 API",
"description": "Tianping Time capsule API",
"version": "1.0.0"
},
"host": "tianping.test.rytass.com",
"schemes": [
"http"
{
"100": "Invalid Parameters",
"201": "Account not found",
"202": "Account and password is not matched",
"203": "Access token is invalid",
"301": "Undefined video format",
"302": "Folder not found",
"700": "Geneaolgy not found",
"800": "Option not found",
"995": "Server Error",
@fantasywind
fantasywind / hinet_sms.js
Last active August 29, 2015 14:16
(API) Hinet SMS Sender in Node.js
var net = require('net');
var bufferpack = require('bufferpack');
var ACCOUNT = 'ACCOUNT';
var PASSWORD = 'PASSWORD';
var MOBILE = 'TARGET_NUMBER';
var MESSAGE = 'MESSAGE';
var client = new net.Socket();
client.on('data', function (data) {
@fantasywind
fantasywind / init.sql
Created March 26, 2015 10:48
Einvoice Turnkey MySQL Migration
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
# Dump of table from_config
/// var encryptedstring = Crypt.Encrypt("我要加密", "This is password", "Taisugar2015", "SHA1", 3, "1qazxsw23edcvfr4", 256);
/// var decryptedstring = Crypt.Decrypt(encryptedstring, "This is password", "Taisugar2015", "SHA1", 3, "1qazxsw23edcvfr4", 256);
/// </summary>
/// <param name="passtext"></param>
/// <param name="passPhrase"></param>
/// <param name="saltValue"></param>
/// <param name="hashAlgorithm"></param>
/// <param name="passwordIterations"></param>
/// <param name="initVector"></param>
/// <param name="keySize"></param>
@fantasywind
fantasywind / gist:959209cce7848518aec5
Last active September 18, 2015 11:05
Sizmek Apple Daily Test Formats
<!-- Suooprt Browsers IE 11, Edge, Chrome, Firefox, Safari, Opera -->
<!--
| Format Full Page Opening |
使用說明:
請將 Message Sync, Full Page Opening 放置於廣告版位任意位置,
但順序不得改變,避免複雜的排版造成螢幕大小抓取錯誤的可能。
Door Panel 請直接放置在顯示位置容器中
-->
<!-- Message Sync -->
@fantasywind
fantasywind / .eslintrc
Last active November 2, 2015 17:54
Rytass ECMAScript Lint
{
"plugins": [
"react"
],
"ecmaFeatures": {
"jsx": true,
"modules": true
},
"env": {