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
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 { |
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 |
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
function throttle( fn, time ) { var t = 0; return function() { var args = arguments, ctx = this; clearTimeout(t); t = setTimeout( function() { fn.apply( ctx, args ); }, time ); }; } |
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
using UnityEngine; | |
using System.Collections; | |
public class UnityChanController : MonoBehaviour | |
{ | |
public CharacterController ctrl; | |
Animator animator; | |
// Use this for initialization |
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
using UnityEngine; | |
using System.Collections; | |
public class UnityChanController : MonoBehaviour | |
{ | |
public float gravity = 9.8f; | |
public float jumpSpeed = 1.0f; | |
public CharacterController ctrl; |
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
#!/bin/bash | |
if [ $# -eq 0 ] ; then | |
echo "input app name, plz" | |
exit 0 | |
fi | |
#echo $1 | |
home="/home/mosluce" |
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
#!/usr/bin/env bash | |
export GIT_WORK_TREE=$HOME/apps/{app_name} | |
echo "--> Checking out..." | |
git checkout -f | |
docker-compose start {app_name} |
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
//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'; |
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
//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); | |
} |
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 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){ |
OlderNewer