A list of amazingly awesome PHP libraries, resources and shiny things.
- Composer/Packagist - A package and dependency manager.
- Composer Installers - A multi framework Composer library installer.
/* | |
Copyright (c) 2013 Stuffit at codepen.io (http://codepen.io/stuffit) | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
*/ | |
// settings |
Choose a ticket class: <select id="tickets"></select> | |
<p id="ticketOutput"></p> | |
<script id="ticketTemplate" type="text/x-jquery-tmpl"> | |
{{if chosenTicket}} | |
You have chosen <b>${ chosenTicket().name }</b> | |
($${ chosenTicket().price }) | |
<button data-bind="click: resetTicket">Clear</button> | |
{{/if}} |
A list of amazingly awesome PHP libraries, resources and shiny things.
Attention: if you attempt to fork this gist, github will think that you are a spammer and you will have to confirm that you are human with them. Apparantly there are too many links in this list. Also I update it rather frequently (see revisions on the left), so it's probably wise to not fork it anyway.
捕捉浏览器中的JS运行时错误,主要通过监听window.onerror来实现。但是对于不同的脚本执行方式以及不同的浏览器,能捕获到的信息会有区别。
window.onerror 讲接收3个参数:
msg
:错误描述,比如:a is not definedurl
:出错脚本所在的urllineNumber
:出错脚本的行数本文将对不同浏览器和不同的脚本执行方式进行测试,并总结这些区别。
public class t { | |
public static void main ( String[] args ) { | |
double earthRadius = 6371; //地球半径,单位km | |
double lat1 = 31.215961; | |
double lng1 = 121.456083; | |
// 经纬度差0.000001 | |
double lat2 = 31.215960; | |
double lng2 = 121.456082; | |
double dLat = Math.toRadians ( lat2 - lat1 ); |
<?php | |
/* | |
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP) | |
Author: _ck_ (with contributions by GK, stasilok) | |
Version: 0.1.6 | |
Free for any kind of use or modification, I am not responsible for anything, please share your improvements | |
* revision history | |
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter | |
0.1.5 2013-04-12 added graphs to visualize cache state, please report any browser/style bugs |
<?php | |
/** | |
* SplClassLoader implementation that implements the technical interoperability | |
* standards for PHP 5.3 namespaces and class names. | |
* | |
* http://groups.google.com/group/php-standards/web/final-proposal | |
* | |
* // Example which loads classes for the Doctrine Common package in the | |
* // Doctrine\Common namespace. |
<?php | |
/** | |
* LDAP PHP Change Password Webpage | |
* @author: Matt Rude <http://mattrude.com> | |
* @website: http://technology.mattrude.com/2010/11/ldap-php-change-password-webpage/ | |
* | |
* | |
* GNU GENERAL PUBLIC LICENSE | |
* Version 2, June 1991 |