This file contains hidden or 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
| // server side setting about shadowsocks | |
| { | |
| "server":"0.0.0.0", | |
| "server_port":8838, | |
| "local_address":"127.0.0.1", | |
| "local_port":1080, | |
| "password":"ys123456", | |
| "timeout":600, | |
| "method":"aes-256-cfb" | |
| } |
This file contains hidden or 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
| // Change the bug when the list loation is not in the databse, | |
| // the post data of lat and lng are undefined, actually, we need | |
| // to convert the data structure from the array to a javascript object | |
| //(lag: and lng: in coords rather than coords[0] and coords[1] | |
| body_post.coords = { | |
| lng: body_post.coords[0], | |
| lat: body_post.coords[1] | |
| }; |
This file contains hidden or 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
| // command line below to enable this requirements | |
| gsettings set org.gnome.desktop.peripherals.touchpad send-events disabled-on-external-mouse | |
| // get current situation | |
| gsettings get org.gnome.desktop.peripherals.touchpad send-events | |
| // options |
This file contains hidden or 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
| // need to require the reports.js(schema file in model) in db connect file | |
| [nodemon] restarting due to changes... | |
| [nodemon] starting `node ./bin/www` | |
| (node:26035) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit | |
| /home/sheng/Work/smr_pjt_loct_dr/node_modules/mongoose/lib/index.js:382 | |
| throw new mongoose.Error.MissingSchemaError(name); | |
| ^ | |
| MongooseError: Schema hasn't been registered for model "Report". |
This file contains hidden or 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
| // example when using _id as a query condition | |
| // need to utilize the $element and $ (Positional projection) | |
| > db.users.find({"_id": ObjectId("5974c986dea685349a68242a"), 'userLocation': {"$elemMatch": {'locationName': "Uni Kebab"}}}, {"userLocation.$": 1}).pretty(); | |
| { | |
| "_id" : ObjectId("5974c986dea685349a68242a"), | |
| "userLocation" : [ | |
| { | |
| "locationName" : "Uni Kebab", | |
| "locationAddress" : "190 Burgess Road, Southampton", |
This file contains hidden or 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
| 2017-07-23T23:24:22.178525+00:00 app[web.1]: module.js:472 | |
| 2017-07-23T23:24:22.178541+00:00 app[web.1]: throw err; | |
| 2017-07-23T23:24:22.178542+00:00 app[web.1]: | |
| 2017-07-23T23:24:22.178544+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:470:15) | |
| 2017-07-23T23:24:22.178545+00:00 app[web.1]: at Function.Module._load (module.js:418:25) | |
| 2017-07-23T23:24:22.178545+00:00 app[web.1]: at Module.require (module.js:498:17) | |
| 2017-07-23T23:24:22.178542+00:00 app[web.1]: ^ | |
| 2017-07-23T23:24:22.178546+00:00 app[web.1]: at require (internal/module.js:20:19) | |
| 2017-07-23T23:24:22.178543+00:00 app[web.1]: Error: Cannot find module 'passport' | |
| 2017-07-23T23:24:22.178547+00:00 app[web.1]: at Module._compile (module.js:571:32) |
This file contains hidden or 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
| / | |
| means the root of the current drive; | |
| ./ | |
| means the current directory; | |
| ../ | |
| means the parent of the current directory. |
This file contains hidden or 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
| // Require the Mongoose | |
| var mongoose = require('mongoose'); | |
| // Schema for user | |
| var UserSchema = new mongoose.Schema({ | |
| username: {type: String, required: true}, | |
| email: {type: String, unique: true, required: true}, | |
| password: {type: String, required: true}, | |
| }); |
This file contains hidden or 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
| // OS: ubuntu 16.04 LTS | |
| // Every time in the evening after 9 pm, the HTML5 GeoLocation API in Chromium and Firefox would not work. | |
| // Is is a bug or something? |
This file contains hidden or 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
| Check the type of location:string | |
| get the query location:15 | |
| location type: "[object Object]" | |
| name:undefined | |
| location id:ChIJ2WK8mvNzdEgRyilaQFDCp1M | |
| // HTTP has no notation of types, everything is a string, as for req.query, it cannot pass the JavaScript Object, only string | |
| // even as for integers. |