This file contains 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
$scope.get_romig_24g=function(){ | |
return $scope.handle().then(function(res){ | |
console.log("$scope.ip[0] "+ $scope.ip[0]) | |
console.log("res "+res) | |
let url= "http://"+res+"/boafrm/formWlanRedirect?redirect-url=/wladvanced.htm&wlan_id=1" | |
return url | |
},function(err){ | |
console.log(err) | |
err=err+"no ip" | |
return err |
This file contains 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
console.log(1) | |
step1(x, function(value1){ | |
console.log(2) | |
//do something... | |
step2(y, function(value2){ | |
console.log(3) | |
//do something... | |
step3(z, function(value3){ | |
//do something... | |
console.log(4) |
This file contains 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
var Home = { | |
Box: function () { | |
this.color = 'black'; | |
this.paint = function (value, cb) { | |
// delay 3 seconds. | |
//var now = new Date().getTime(); | |
//while (new Date().getTime() < now + 3000) { | |
// /* do nothing */ | |
//} | |
this.color = value; |
This file contains 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
// 就上面的案例重組一下 | |
import UIKit | |
struct FilmFestival { | |
var Name: String = "" | |
var FormattedPrice: Int = 0 | |
} | |
struct Ticketing { | |
var Name: String = "" | |
var FormattedPrice: Int = 0 |
This file contains 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
//: Playground - noun: a place where people can play | |
import UIKit | |
// This is for dmoe, you can use a generice type to limit your observer to an UIViewController for common usage. | |
protocol Notifiable { | |
var name: Notification.Name { get } | |
func observe(by observer: Any, withSelector selector: Selector, object: Any?) | |
func post(object: Any? ,userInfo: [AnyHashable: Any]?) | |
static func remove(observer: Any) |
This file contains 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
import UIKit | |
import Firebase | |
class StoreTableViewController: UITableViewController { | |
let flavorSet = NSUserDefaults.standardUserDefaults() | |
let conditionRef = FIRDatabase.database().reference() | |
var stores = [Stores]() |
This file contains 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
<html> | |
<%- include ../partials/head.ejs %> | |
<% | |
var foodTypes = ['特餐', '飯類', '麵食', '水餃', '炸物', '湯類', '飲料']; | |
%> | |
<body> | |
<div class="container"> | |
<%- include menu.ejs %> | |
<div class="row well" style="margin-top: 8px;"> | |
<% if (typeof error !== 'undefined') { %> |
This file contains 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
router.get('/2', function (req, res) { | |
Block.findOne({ps: 1}).exec().then(function(block) { | |
//原本你的cb那一塊 | |
res.render('indexTest', { | |
title: '首頁', | |
user: req.session.user, | |
block: block, | |
success: req.flash('success').toString(), | |
error: req.flash('error').toString() | |
}); |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |