Skip to content

Instantly share code, notes, and snippets.

View mosluce's full-sized avatar

mosluce mosluce

View GitHub Profile
using UnityEngine;
using System.Collections;
public class UnityChanController : MonoBehaviour
{
public CharacterController ctrl;
Animator animator;
// Use this for initialization
using UnityEngine;
using System.Collections;
public class UnityChanController : MonoBehaviour
{
public float gravity = 9.8f;
public float jumpSpeed = 1.0f;
public CharacterController ctrl;
#!/bin/bash
if [ $# -eq 0 ] ; then
echo "input app name, plz"
exit 0
fi
#echo $1
home="/home/mosluce"
#!/usr/bin/env bash
export GIT_WORK_TREE=$HOME/apps/{app_name}
echo "--> Checking out..."
git checkout -f
docker-compose start {app_name}
function parseQuery(json) {
var q = "";
var first = true;
for (var key in json) {
if(json[key]=="" || json[key]==null) continue;
if (first) {
first = false;
q += (key + "=" + json[key]);
} else {
//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);
}
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){
@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
function throttle( fn, time ) { var t = 0; return function() { var args = arguments, ctx = this; clearTimeout(t); t = setTimeout( function() { fn.apply( ctx, args ); }, time ); }; }
module.exports = function(Schema) {
return {
table: 'OAuthUser',
schema: {
local : {
email : String,
password : String,
},
facebook : {
id : String,