Skip to content

Instantly share code, notes, and snippets.

View mosluce's full-sized avatar

mosluce mosluce

View GitHub Profile
@mosluce
mosluce / AppDelegate.m
Created June 7, 2016 12:48
React Push (iOS) : register 沒反應
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "AppDelegate.h"
//
// ShadowViewB.swift
// SwiftShadow
//
// Created by 默司 on 2016/8/4.
// Copyright © 2016年 默司. All rights reserved.
//
import UIKit
//
// ViewController.swift
// SwiftPicker
//
// Created by 默司 on 2016/8/8.
// Copyright © 2016年 默司. All rights reserved.
//
import UIKit
//
// ViewController.swift
// SwiftPicker
//
// Created by 默司 on 2016/8/8.
// Copyright © 2016年 默司. All rights reserved.
//
import UIKit
@mosluce
mosluce / swift_closure.swift
Last active August 18, 2016 04:57
Swift Closure: How / Why - 剛開始接觸 Closure 應該很多人被書裡寫的弄到頭昏腦脹,不知道到底怎樣寫才對,這邊用案例說明
//: Playground - noun: a place where people can play
import UIKit
var closure: ((a: Int, b: Int) -> Int)!
//基本型
closure = {(a: Int, b: Int) -> Int in
return a + b
}
@mosluce
mosluce / swift_function.swift
Created August 18, 2016 05:08
Swift Function: 無限參數
//: Playground - noun: a place where people can play
import UIKit
func hello(people: String...) {
for person in people {
let str = "Hello \(person)"
print(str)
}
}
var express = require('express');
var router = express.Router();
var Promise = require('bluebird');
var moment = require('moment');
var _ = require('lodash');
var mongoose = require('mongoose'),
Verification = mongoose.model('Verification'),
Account = mongoose.model('Account');
var appKey = 'APPLICATION_KEY';
@mosluce
mosluce / MapViewController.swift
Last active September 20, 2016 04:38
MapKit Demo: 地圖加Annotation以及畫線
//
// ViewController.swift
// NewMapKit
//
// Created by 默司 on 2016/9/20.
// Copyright © 2016年 默司. All rights reserved.
//
import UIKit
import MapKit
@mosluce
mosluce / firebase_problem2.swift
Last active October 6, 2016 18:08 — forked from lizolni/firebase_problem2.swift
firebase problem2
import UIKit
import Firebase
class StoreTableViewController: UITableViewController {
let flavorSet = NSUserDefaults.standardUserDefaults()
let conditionRef = FIRDatabase.database().reference()
var stores = [Stores]()
//
// ViewController.swift
// Promise
//
// Created by 默司 on 2016/10/12.
// Copyright © 2016年 默司. All rights reserved.
//
import UIKit
import PromiseKit