欢迎来到 艾瑞可erik 的魔法世界 🧙‍♂️

给我一个需求,还你一个项目——别管它是什么。这就是全栈。

📚 291 篇文章 🏷️ 504 个标签 📂 90 个分类

🔥 最新文章

佛晓之瞳

IMG_20150128_232954入夏,深南大道上。 鸟不归巢正是迁徙的时节,嘈杂的车声间总会带着一丝清脆的乐章,久久不能忘却。我依然在这大道上,看着车流,伴着绿叶无尽的抬头,驻足。路已不是那么漫长,依然充斥着绿色的路旁,在不断的暗暗无光。 夜,悄悄近了。没有清新的自然风味,到处都是人的气息,这夜竟然活气多了。海风不断带来新的润色,舔一下额头,抱一下树梢,就这样没知趣的对周围放肆起来。这大道上一节节是花草,一节节又是人群你看到的正如你听到的一样,魅力中不失大爷的风范。 高楼不断的生长中,尘土醉了,榕树却枯了。 中山公园,南侧。 南头,关内关外的区分点。 北环外是中山公园,葱葱的荔枝、龙眼,宽敞的草坪、湖泊。随处可见欢声笑语,我们都在。 可以躺在草坪上,懒懒的晒着太阳,或奔跑追着风筝,拍拍羽毛球…… 没有说不出的不悦,就是少了点期待中的味道。

Eye of Dawn

IMG_20150128_232954Early summer, on Shennan Boulevard. Birds not yet returning to their nests — it is precisely the season of migration; amid the noisy traffic there is always a touch of crisp melody that lingers in the mind and cannot be forgotten for a long time. I am still on this boulevard, watching the stream of cars, lifting my head endlessly along with the green leaves, and halting. The road is no longer so long; the roadside, still filled with green, keeps darkening, lightless. Night quietly draws near. There is no fresh natural flavour; the breath of people is everywhere, and yet this night has come to life all the more. The sea breeze keeps bringing new touches of colour, licking the forehead, embracing the treetops, and just like that, with no sense of propriety, it runs wild over everything around. Along this boulevard there are plants and flowers in one stretch and crowds of people in the next; what you see is exactly what you hear — charm without losing the bearing of an old uncle. As the high-rises keep growing, the dust is drunk, but the banyan trees have withered. Zhongshan Park, south side. Nantou, the dividing point between inside and outside the pass. Outside the North Ring is Zhongshan Park: lush lychees and longans, spacious lawns and lakes. Laughter is everywhere to be seen, and we are all there. You can lie on the lawn, lazily basking in the sun, or run after a kite, or bat a shuttlecock around… There is no inexpressible displeasure — only that the flavour you had been looking forward to is a little lacking.

RunJS 常见问题

摘自runjs

  • RunJS 是什么?

    RunJS 是一个在线的 HTML、Javascript、CSS 等 web 前端代码的编辑分享平台,拥有实时预览、高亮显示、代码格式化等功能,我们提供 OSChina、微博、qq、github、google、yahoo、hotmail这七种登录方式,你只需要有七种任意一个帐号就可以点击右上角的登 录按钮来立即体验RunJS。

RunJS FAQ

Excerpted from runjs

  • What is RunJS?

    RunJS is an online platform for editing and sharing web front-end code such as HTML, Javascript and CSS, with features like live preview, syntax highlighting and code formatting. We offer seven login methods: OSChina, Weibo, qq, github, google, yahoo and hotmail. You only need an account with any one of the seven to click the Login button in the top right corner and start using RunJS right away.

18个CSS精简压缩工具和技巧

作者: 帕兰 我们已看过8个在线CSS优化工具和CSS代码精简技巧,本文则为你带来18个CSS精简压缩工具和技巧。

压缩还是不压缩

在我们讨论如何压缩CSS之前,需要注意一下在压缩和代码的易读性上常常要有个平衡。很多编码者以其CSS组织清晰为傲,而且并不希望自己的代码被 通过压缩器去掉注释和断行。作为一个设计师,你应该分析你所编写的代码的目标。如果你要创建一个小的只需要几行CSS的网站,可能就没有必要做额外的压 缩。同样,如果你在编写需要和一个开放团队分享的代码,插入额外的注释和断行可以节省你的同事的大量时间并获得他们真心的感谢。然而,如果你在设计一个需 要大量CSS的大型网站,你肯定要注意你的文件大小并进你所能保持其最小。 可能在寻找压缩和可能性之间的完美结合上面需要花一些时间,但是它们都值得挖掘而且实现它们的平衡可以让你的工作变得容易很多。同时,很明显并不是说压缩一定会导致可读性的降低。很多可用于压缩代码的技术都能生成更好更有组织的代码。 考虑到这一点儿,让我们开始了解一些技术已保持CSS文件最小化吧。

18 CSS Minification and Compression Tools and Tricks

Author: 帕兰 We have already looked at 8 online CSS optimization tools and CSS code streamlining tricks; this article brings you 18 CSS minification and compression tools and tricks.

To Compress or Not to Compress

Before we discuss how to compress CSS, we should note that there is often a balance to be struck between compression and code readability. Many coders take pride in clearly organized CSS and do not want their code stripped of comments and line breaks by a compressor. As a designer, you should analyze the goal of the code you are writing. If you are creating a small site that needs only a few lines of CSS, extra compression may not be necessary. Likewise, if you are writing code that will be shared with an open team, inserting extra comments and line breaks can save your colleagues a great deal of time and earn their genuine thanks. However, if you are designing a large site that requires a lot of CSS, you will certainly need to watch your file size and keep it as small as you can. Finding the perfect balance between compression and readability may take some time, but both are worth exploring, and striking that balance can make your work much easier. At the same time, it is clear that compression does not necessarily reduce readability. Many of the techniques available for compressing code produce better, more organized code. With that in mind, let’s start looking at some techniques for keeping CSS files minimal.

基于Sphinx构建准实时更新的分布式通用搜索引擎平台

作者:张宴 前言: 2008年7月,我写过一篇文章《基于Sphinx+MySQL的千万级数据全文检索(搜索引擎)架构设计》。有不少网友希望阅读全文,我将该文档整理了一下,分享出来。文档解压后大小为7.33M,共19页。 本站下载地址: http://blog.zyan.cc/book/sphinx/sphinx_mysql.zip 新浪下载分流: http://ishare.iask.sina.com.cn/f/6728201.html 上述文档架构存在的局限,我在2008年12月的文章《亿级数据的高并发通用搜索引擎架构设计》 中已经指出:一是MySQL本身的并发能力有限,在200~300个并发连接下,查询和更新就比较慢了;二是由于MySQL表的主键与Sphinx索引的 ID一一对应,从而无法跨多表建立整站查询,而且新增加类别还得修改配置文件,比较麻烦;三是因为和MySQL集成,无法发挥出Sphinx的优势。虽然 如此,但对于一些写入量不大的搜索应用,已经足够了,或许对很多人会有帮助。

Building a Near-Real-Time Distributed General-Purpose Search Engine Platform with Sphinx

Author: Zhang Yan. Foreword: In July 2008, I wrote an article titled “Architecture Design of a Ten-Million-Scale Full-Text Search (Search Engine) Based on Sphinx+MySQL“. Quite a few readers wanted to read the full text, so I cleaned up the document and shared it. Unzipped, the document is 7.33M and 19 pages. Download link for this site: http://blog.zyan.cc/book/sphinx/sphinx_mysql.zip Sina mirror: http://ishare.iask.sina.com.cn/f/6728201.html The limitations of that document’s architecture, I already pointed out in my December 2008 article “Architecture Design of a High-Concurrency General-Purpose Search Engine for Hundred-Million-Scale Data“: first, MySQL’s own concurrency is limited — under 200-300 concurrent connections, queries and updates get slow; second, because MySQL table primary keys map one-to-one to Sphinx index IDs, you can’t build a site-wide query across multiple tables, and adding a new category means editing the config file, which is a hassle; third, because it’s integrated with MySQL, it can’t bring out Sphinx’s advantages. Even so, for search applications with modest write volume it’s already good enough, and it will probably help a lot of people.

为 MySQL 增加 HTTP/REST 客户端:MySQL UDF 函数 mysql-udf-http 1.0 发布

文章作者:张宴 Mysql-udf-http 是一款简单的MySQL用户自定义函数(UDF, User-Defined Functions),具有http_get()、http_post()、http_put()、http_delete()四个函数,可以在 MySQL数据库中利用HTTP协议进行REST相关操作。 项目网址:http://code.google.com/p/mysql-udf-http/ 中文说明:http://blog.zyan.cc/mysql-udf-http/ 使用环境:Linux操作系统,支持的MySQL版本:5.1.x 和 5.5.x。5.0.x未经测试。 软件作者:张宴

Adding an HTTP/REST Client to MySQL: MySQL UDF Functions mysql-udf-http 1.0 Released

Article author: Zhang Yan. Mysql-udf-http is a simple set of MySQL user-defined functions (UDF, User-Defined Functions) offering four functions — http_get(), http_post(), http_put() and http_delete() — which let you perform REST-related operations inside a MySQL database over the HTTP protocol. Project URL: http://code.google.com/p/mysql-udf-http/ Chinese documentation: http://blog.zyan.cc/mysql-udf-http/ Usage environment: Linux operating system; supported MySQL versions: 5.1.x and 5.5.x. 5.0.x is untested. Software author: Zhang Yan

Understanding the JavaScript timing mechanism in depth

JavaScript timers that easily toy with people’s feelings. JavaScript’s setTimeout and setInterval are two methods that very easily fool people’s feelings, because at first we often assume that once they are called they will execute in the established way. I think many people feel the same. For example

1
2
3
4
setTimeout(function() {
alert('你好!');
}, 0);
setInterval(callbackFunction, 100);

14条改善jQuery代码的技巧

jQuery简单易学,但如果你想写出更漂亮更简洁高效的代码,总需要一些技巧。本文就为你总结了14条改善jQuery代码的技巧。

1.测试并提升你的jQuery选择器水平

这个jQuery选择器实验室非常酷,它能在线免费使用,当然你也能下来到本地离线使用。这个测试页面包含复杂的HTML组合字段,然后你能尝试预定义使用各种jQuery选择器。如果这还不够你也可以自定义选择器。

14 Tips for Improving Your jQuery Code

jQuery is easy to learn, but if you want to write prettier, cleaner and more efficient code, you always need a few tricks. This article summarizes 14 tips for improving your jQuery code for you.

1. Test and level up your jQuery selectors

This jQuery Selector Lab is really cool, it’s free to use online, and of course you can also download it to use offline locally. The test page contains complex combined HTML fields, and then you can try out various predefined jQuery selectors. If that’s not enough you can also define your own selectors.

利用 Flash 完美解决 JavaScript 和 AJAX 跨域 HTTP POST/GET 表单请求

[ 作者:张宴] 最近的一个项目中,需要通过 JavaScript 提交表单数据到另一个域名下的PHP接口(因为数据较大,需要HTTP POST方式提交),并获取PHP接口的返回值,在页面无刷新、无跳转的情况下,更新div标签内的内容。 浏览器出于安全考虑,是不允许JavaScript代码进行跨域操作。JavaScript 和 AJAX 跨域访问分为两大类,一是本域和子域的交互,二是本域和其他域的交互。 一、本域和子域的交互:www.zyan.cc 和 blog.zyan.cc 二、本域和其他域的交互:blog.zyan.cc 和 api.bz 本域和子域的交互,可以通过iframe设置两个域名document.domain = “zyan.cc”,实现统一zyan.cc域下的跨域访问。 本域和其他域的交互,可以通过iframe、代理、JS创建动态脚本等几种方法来实现,这里有篇文章对几种方法作了简要的介绍。 iframe、JS创建动态脚本这两种方法,需要开发者能控制两个域,两端都要编写相应的代码,非常麻烦。在本域服务器上用PHP写个代理中转程序,让 本域PHP程序去读取远程其他域的数据再返回给自己,是常用的方法。但是,在本域“前端是CDN或Squid缓存服务器,后端才是PHP应用程序服务器” 的系统架构下,穿透CDN或Squid去访问不能被缓存的PHP代理中转程序,效率是很低的。

Use Flash to Cleanly Solve JavaScript and AJAX Cross-Domain HTTP POST/GET Form Requests

[ Author: Zhang Yan] In a recent project, I needed to submit form data with JavaScript to a PHP interface under another domain (HTTP POST was required because the data was large), and read back the return value of that PHP interface, updating the contents of a div tag without the page refreshing or navigating. For security reasons, browsers don’t allow JavaScript code to perform cross-domain operations. JavaScript and AJAX cross-domain access falls into two broad categories: one is interaction between the primary domain and a subdomain, the other is interaction between the primary domain and other domains. 1. Interaction between the primary domain and a subdomain: www.zyan.cc and blog.zyan.cc. 2. Interaction between the primary domain and other domains: blog.zyan.cc and api.bz. For primary-domain-to-subdomain interaction, you can set document.domain = “zyan.cc” on both domains through an iframe, giving you cross-domain access under the unified zyan.cc domain. For primary-domain-to-other-domain interaction, you can use several approaches such as iframes, a proxy, or dynamically creating a script from JS; here is an article that briefly introduces several of these methods. The iframe and dynamically-created-script approaches require the developer to control both domains and to write corresponding code on both ends, which is extremely cumbersome. Writing a PHP proxy relay program on the server of your own domain — letting your local PHP program read data from the remote domain and hand it back to you — is a common approach. But under a system architecture where “the front end is a CDN or Squid cache server and the backend is the PHP application server,” going through the CDN or Squid to reach a PHP proxy relay program that can’t be cached is very inefficient.

千元机,标杆门槛再提高 -- TCL 么么哒 3N 分享体验

陈繁leon 前言 · 千元机门槛提升: 千元机可以说是近年来充量的利器,几乎每个月都有新机。不是上个月联想发售599的新机,就是这个月魅族发售999魅蓝,还是下个月红米又要更新换代。似 乎厂商在千元级上都乐此不疲,但又由于价格限制,现在的千元机差异性不大。现在消费者越来越理性,千元机差异不大的今天,要让用户选择我们某方面要远比对 方出色。而现在千元就也进行着更替,把每个细节更加优秀,比如今年很显眼的升级就是屏幕升级1080P、4G、增加容量、3000毫安大电池等等。

Budget Phones Raise the Bar Again -- TCL 么么哒 3N Hands-on Review

陈繁leon Foreword · The bar for budget phones rises: Budget phones have arguably been the volume-driving weapon of recent years, with a new model appearing almost every month. If it isn’t Lenovo launching a 599-yuan phone last month, it’s Meizu releasing the 999-yuan Meilan this month, or Redmi getting its next generation refresh the month after. Manufacturers seem tireless at the thousand-yuan tier, but because of the price limits, today’s budget phones are not all that different from one another. Consumers are getting more and more rational, and now that budget phones barely differ, getting users to choose ours means we have to be far better than the competition in some respect. And the thousand-yuan segment is iterating too, making every detail better: the most visible upgrades this year are 1080P screens, 4G, bigger storage, 3000mAh large batteries and so on.