Skip to content

Instantly share code, notes, and snippets.

View mosluce's full-sized avatar

mosluce mosluce

View GitHub Profile
@mosluce
mosluce / ALL.js
Last active January 30, 2019 07:33 — forked from Hawksbillcat/ALL
$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
@mosluce
mosluce / 123.js
Last active January 11, 2018 01:30 — forked from anonymous/123.js
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)
@mosluce
mosluce / 回呼.js
Last active May 3, 2017 14:20 — forked from matt0224/回呼
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;
// 就上面的案例重組一下
import UIKit
struct FilmFestival {
var Name: String = ""
var FormattedPrice: Int = 0
}
struct Ticketing {
var Name: String = ""
var FormattedPrice: Int = 0
@mosluce
mosluce / ProtocolNotofication.swift
Created November 22, 2016 13:15 — forked from pofat/ProtocolNotofication.swift
Deal with notification with protocol-oriented programing in Swift
//: 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)
@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]()
<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') { %>
@mosluce
mosluce / block.js
Last active March 15, 2016 14:02 — forked from l02162010/block.js
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()
});
@mosluce
mosluce / 0_reuse_code.js
Created November 25, 2013 06:45
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console