Skip to content

Instantly share code, notes, and snippets.

View mosluce's full-sized avatar

mosluce mosluce

View GitHub Profile
a.change(function(){
setTimeout(function(){
//延遲一下再進行邏輯
}, 250)
})
{
sNum: String,
logs: [{
date: Date
}],
count: Number
}
//data list example
[{
module.exports = function(Schema) {
return {
table: 'OAuthUser',
schema: {
local : {
email : String,
password : String,
},
facebook : {
id : String,
var i = 0;
Check.updataPartly = function(foodName, partly, numBig, numSamll, callback){
//打開資料庫
mongodb.open(function(err,db){
if (err) {
return callback(err);
}
//讀取checks的集合
db.collection('checks',function(err,collection){
//npm install --save bluebird
var Promise = require('bluebird');
Check.updataPartly = function(foodName, partly, numBig, numSamll, callback){
//打開資料庫
mongodb.open(function(err,db){
if (err) {
return callback(err);
}
@mosluce
mosluce / mongoose-setup-module.js
Last active November 8, 2016 15:57
mongoose best practice template for node.js
//npm install --save mongoose
//npm install --save mongoose-timestamp
//npm install --save bluebird
"use strict";
var Promise = require('bluebird');
var mongoose = require('mongoose'), timestamps = require('mongoose-timestamp');
var path = require('path'), fs = require('fs');
const url = process.env.MONGO_URL || 'mongodb://localhost/test';
#!/usr/bin/env bash
export GIT_WORK_TREE=$HOME/apps/{app_name}
echo "--> Checking out..."
git checkout -f
docker-compose start {app_name}
#!/bin/bash
if [ $# -eq 0 ] ; then
echo "input app name, plz"
exit 0
fi
#echo $1
home="/home/mosluce"
using UnityEngine;
using System.Collections;
public class UnityChanController : MonoBehaviour
{
public float gravity = 9.8f;
public float jumpSpeed = 1.0f;
public CharacterController ctrl;
using UnityEngine;
using System.Collections;
public class UnityChanController : MonoBehaviour
{
public CharacterController ctrl;
Animator animator;
// Use this for initialization