Monthly Archives: 八月 2018

个人学习历程问题持续汇总解决

个人目前学习遇到的最严重的问题是学习了一部分知识后,接续后突然对后面学习信心不足造成半途而废的问题。
解决办法:
重点因素:

1.仪式感很重要。
仪式感主要是为了全身心进入学习状态,使自己在一个状态导引下进入到一个境界,这个跟打坐道理一样,先要集中精力心系一处然后入定。达到二禅最好,如果不具备这个素质。带耳机使自己避免外界干扰。

2.规划1-2小时候的学习目标。
用10分钟左右。这样使目的性较强,会有收获感。 大的规划目前没有这个心理,但小的规划一定要做起来。这样有了积累就可以做大的规划复习。

3.阶段性小结,很重要,接续很重要,知道下面一部分要学什么很重要,一定要做到”知”,然后行。知行要合一的。
这个部分很重要,是为衔接做准备,有了好的接续下一部分学习就不会盲从,也是为知做准备。知道了自然而行。中途有重要事情被打断的话也要脑子过滤一遍。然后标记下。

4.体能跟上,情绪管理要跟上。
* 高效学习是很消耗体能,所以水,糖类 要跟上。
* 情绪管理要跟上学习之前,最好状态良好。不要有不良因素打扰。
* 时间方面造成9-12点,以后可以早起一些。中午一定要睡觉,每次睡觉之前要让自己意识到只有睡觉好了下午才可以高效饱满的学习。一般睡到14:00中左右就可以学习了。

5.学习的时候用脑用手用眼。不要贪图一时之快。要眼到心到。
切记贪,学习是长跑。要明确该知识点达到程度,了解,熟悉,掌握的区别,所以用的心力就不一样。

brackets can not auto-indent and break line when close tags solution

mac:file–>preference–>brackets.json

add those lines can be solved:

"closeBrackets": true,
"closeTags": {
"whenOpening": true, ## customersize ,according yourself,true|false
"whenClosing": true,
"dontCloseTags": ["br", "hr", "img", "input", "link", "meta", "area", "base", "col", "command", "embed", "keygen", "param", "source", "track", "wbr"],
"indentTags": ["ul", "ol", "div", "section", "table", "tr","html","head","title","body"]
}

以上是解决brackets自动close-tags后 光标不自动缩进并换行的问题。

The best practise steps to make a website

1. Define your project

Start off by defining the goal of your project. This can be showing your portfolio to the world, selling an e-book, building a blog, etc.
Also define your audience. Ask yourself: which is the typical user that will visit my website?
This is important, because you should always design with your goal and audience in mind.

2. Plan out everything

Once your project is defined, plan your content carefully. This includes text, images, videos, icons, etc.
Remember what I told you about visual hierarchy. It plays an important role when you start thinking about what you want on your website and what you don’t. Defining the content before actually starting the design is called the content-first approach. It means that you should design for the content, instead of designing a webpage and then filling it with some stuff.
Define the navigation.
Define the site structure. You can draw a sitemap in this step if we’re talking about a bigger project.

3. Sketch your ideas before you design

Now it’s time to get inspired and think about your design.
Then, get the ideas out of your head. And with that I mean that you should sketch your ideas before you start designing. It will help you explore ideas and create a concept of what you want to build. Using pencil and paper is a great way of quickly retaining your valuable ideas.
Make as many sketches as you want, but don’t spend too much time perfecting anything. Once you have an initial idea, you can concentrate on the details when designing in HTML and CSS.
I advise you to never, ever start designing without having an idea of what you want to build. Getting inspiration is very important in this phase, and I already told you how to do that!

4. Design and develop your website

After sketching, start to design your website using all the guidelines and tips you’ve learned in the web design section.
You’ll do that using HTML and CSS, which is called designing in the browser. Designing in the browser is basically designing and developing at the same time.
There are more and more designers leaving traditional design programs such as Photoshop and start designing in the browser. The biggest reason for this is that you can’t design responsive websites in photoshop. It also saves you tons of time.
In this phase, you’ll use your sketches, content and planning decisions you’ve made in steps 1, 2 and 3.

5. It’s not done yet: optimization

Before you can actually launch your beautiful masterpiece for the world to see it, we have to optimize its performance in terms of site speed.
You also need to do some basic search engine optimization (SEO) for search engines such as google.

6. Launch the masterpiece

Your optimized website is now finally ready to launch.
All you need for launching is a webserver that will host your website and deliver it to the world.

7. Site maintenance

The launch of your website is not the end of the story.
Now it’s time to monitor your users’ behavior and make some changes to your website if necessary.
You should also update your content regularly in order to show your users that your website is alive! For instance, a blog can be a great way of doing that.

pac脚本配置+tinyhttp代理服务器搭建

选择了最简单的方案就是根据所访问的域名来配置pac脚本。这样对于他们这种电脑不精通的来说客户端配置方面是最简单的最方便临时用的了。
基本原理: windows配置pac在线地址,pac脚本里面根据特定网址返回相应的http代理服务器地址用于网络路由。

    服务器配置:

  • tinyhttp-http代理服务器
  • pac脚本
  • ngnix-server

环境:
client os:windows
server os:ubuntu
Basic Path:
client window(ie) –> nginx-server(nginx) –> through pac script get proxy address(pac script) –> according proxy address to reach http server(tinyhttp) –> target domain

server端配置:

1.tinyhttp install:

apt-get update
apt-get tinyhttp
tinyhttp configuration:
/etc/tinyhttp.conf

User nobody
Group nogroup
Port 8001 #根据需要配置 但注意防火墙问题。让端口畅通
Timeout 600
DefaultErrorFile "/usr/share/tinyproxy/default.html"
StatFile "/usr/share/tinyproxy/stats.html"
Logfile "/var/log/tinyproxy/tinyproxy.log"
LogLevel Info
PidFile "/var/run/tinyproxy/tinyproxy.pid"
MaxClients 100
MinSpareServers 5
MaxSpareServers 20
StartServers 10
MaxRequestsPerChild 0
#Allow 127.0.0.1 #注释掉 要不只能本地来用
ViaProxyName "tinyproxy"
ConnectPort 443
ConnectPort 563

2.pac script: test.pac


function FindProxyForURL(url, host) {
if (host == "xxxx.org")
return "PROXY ip:port";
if (host == "baidu.com")
return "PROXY ip:port";
else
return "DIRECT";
}

3.ngnix install: apt-get update;apt-get nginx

把test.pac这个文件放到默认root路径下并测试可以访问
wget http://server-ip:port/test.pac

client 配置:
1.Windows平台中系统配置
在控制面板 | Internet选项,选择连接选项卡,点击“”局域网设置“按钮,在弹出的对话框中勾选”使用自动配置脚本“,在地址文本框中输入PAC文件的URL(http://server-ip:port/test.pac)或本地路径位置(file://xxx)
2. 如果用chrome之类的可以SwitchyOmega 里面配置pac在线地址(http://server-ip:port/test.pac)

重点是如何写pac脚本。具体详细pac脚本的说明都在如下参考地址里面,可以根据不同规则来过滤。注意本方案只是临时方案有很多潜在的安全问题。

参考:https://findproxyforurl.com/example-pac-file/