Skip to content

Instantly share code, notes, and snippets.

var http = require('http');
var url = require('url');
var fs = require('fs');
var path = require('path');
/*var targetURL = process.argv[2] || null;*/
var targetURL = 'http://www.stust.edu.tw/';
if (!targetURL) {
@jacky810124
jacky810124 / error
Last active August 29, 2015 14:20
Cannot read property 'theFile' of undefined
TypeError: Cannot read property 'theFile' of undefined
at C:\Users\Kang\WebstormProjects\ftpserver\server.js:25:26
at Layer.handle [as handle_request] (C:\Users\Kang\WebstormProjects\ftpserver\node_modules\express\lib\router\layer.js:82:5)
at next (C:\Users\Kang\WebstormProjects\ftpserver\node_modules\express\lib\router\route.js:110:13)
at Route.dispatch (C:\Users\Kang\WebstormProjects\ftpserver\node_modules\express\lib\router\route.js:91:3)
at Layer.handle [as handle_request] (C:\Users\Kang\WebstormProjects\ftpserver\node_modules\express\lib\router\layer.js:82:5)
at C:\Users\Kang\WebstormProjects\ftpserver\node_modules\express\lib\router\index.js:267:22
at Function.proto.process_params (C:\Users\Kang\WebstormProjects\ftpserver\node_modules\express\lib\router\index.js:321:12)
at next (C:\Users\Kang\WebstormProjects\ftpserver\node_modules\express\lib\router\index.js:261:10)
at expressInit (C:\Users\Kang\WebstormProjects\ftpserver\node_modules\express\lib\middleware\init.js:23:5)
function Post() {
//example 1
this.getTen = function(){}
}
//example 2
Post.prototype.getTen = function(){}
//example 3
We couldn’t find that file to show.
@jacky810124
jacky810124 / better-nodejs-require-paths.md
Created August 25, 2016 20:43 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

const JackyHuang = {
username: "Jacky Huang",
gender: "Male",
birthday: "1992-01-24",
skill: {
front_end: ['HTML', 'CSS', 'JavaScript', 'jQuery', 'SASS', 'Bootstrap', 'Vue', 'React', 'ES6', 'RWD', 'Redux'],
back_end: ['NodeJS', 'Express', 'Mocha'],
experiences: [
'Familiar with git version control',
const portfolio = [
{
name: "Facebook messenger bot using AWS Lamba and API Gateway",
url: "https://www.facebook.com/events/724852200951265/",
repo: "https://github.com/goodideas-studio/facebook-messenger-bot-using-aws"
}, {
name: "uni-order-no",
description: "Unique order no generator",
repo: "https://github.com/jacky810124/uni-order-no"
}, {
const 404 = 'Page Not Found'
Axure RP 7.0注册码
用户名:axureuser
序列号:8wFfIX7a8hHq6yAy6T8zCz5R0NBKeVxo9IKu+kgKh79FL6IyPD6lK7G6+tqEV4LG
class State {
approve() {
throw 'Should override this function'
}
reject() {
throw 'Should override this function'
}
}
class Verifying extends State {