Tim's Blog
Hi I'm Tim Zeng @Hong Kong.
Passionate about Travel, Music, Basketball. Oh of cource, Coding
-
How to use Map, Filter and Reduce in JavascriptMAPMap like filter & foreach takes a callback and run it against every element on the array but whats makes it unique is it generate a new array based on your existing array.Let’s understand ma...
-
Adding an existing project to GitHubCreate a new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or gitignore files. You can add these files after your project has been pushed t...
-
Load Balancing with Nginx and Docker这次利用Docker建立3个Containers, 分别是 Nginx,Django + uWSGI, Postgres (https://github.com/zengtian006/Load-Balancing-with-Nginx-and-Docker)主要说有一下Nignx 里面的DockerfileFROM nginx:latest//先將 nginx.conf 複製到 /etc/...
-
Deploy Django Application with Docker我们目前已经建立好了一个DRF 的 Application我们在 Setting.py 里面做一些调整,将之前的SQLite 数据库 改成 PostgreSQLDATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'postgres', ...
-
Building RESTFul APIs with Django REST frameworkPreparation Install Python Install Django pip install django If you are using Python 3.0+ please input the following command pip3 install django Install Django-REST-framework...
-
Spring Boot 参考指南之入门指南Spring Boot 介绍这个段落提供 Spring Boot 参考指南的简要综述。将它视作其他部分介绍的指引。你可以顺次阅读本参考指南,或者跳过你不感兴趣的部分。1.关于资料Spring Boot 参考指南现提供 html,pdf 以及 epub 版本,最新版可以访问 http://docs.spring.io/spring-boot/docs/current/reference。这些资...
-
SpringBoot 的 application.properties 配置文件
“”
# ===================================================================# COMMON SPRING BOOT PROPERTIES## This sample file is provided as a guideline. Do NOT copy it in its# entirety to your own application. ^^^# ===================================================================# ----------------------------------------# CORE PROPERT...
-
CodeIgniter 钩子
“CodeIgniter Hooks”
简介CodeIgniter 在启动的过程中,可以在某个地方让它自动的执行自己编写的函数,完成一个特定的功能,或者说成是脚本,这个时候就需要 CodeIgniter 中的钩子扩展。突然觉得和 Spring 中的 AOP 面向切面(Aspect)很类似,就是说在系统执行的什么时候会自动的执行其他功能代码,例如Before(前) 、After-returning(返回后) 、After-throwing(抛出后)、Introduction(引入)。启用钩子 在 application/config/config.php 文件里找到 $config[‘enable_hooks’] = FALSE,将 FALSE 改 TRUE ,启动钩子。 $config['enable_ho...
-
Ajax 跨域访问
“ajax access origin resource”
##问题现象当出现跨域访问的时候, ajax 通常会报类似如下错误: XMLHttpRequest cannot load http://localhost:8000/simple/api/users/me/login. Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:8080’ is therefore not allowed access.解决办法Tomcat设置允许跨域访问这里描述以Tomcat...
-
The server quit without updating PID file.今天在命令行启动MySQL的时候, 报了一个错误, 无法启动. 如下..ERROR! The server quit without updating PID file (/usr/local/var/mysql/WngLMng-MacBook.local.pid).解决办法如下, 将MySQL下的对应的err文件删除即可.$ rm -r /usr/local/var/mysql/WngLM...
-
Memcache简单介绍最近在学习有关缓存的一些知识,了解到有Memcache和Redis,那我先来介绍一下我目前了解到Memcache吧。有些人可能会在网上看到Memcache和Memcached这两个词,这两个个东西其实不必太在意,只不过Memcache是这个项目的名称,而Memcached是项目的服务端主程序名称。##简介Memcached官网Memcache是一个基于内存的,采用key-value的存储方式...