This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.
— Erik
function isPointInPoly(poly, pt) { | |
for(var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) | |
((poly[i][1] <= pt.y && pt.y < poly[j][1]) || (poly[j][1] <= pt.y && pt.y < poly[i][1])) && (pt.x < (poly[j][0] - poly[i][0]) * (pt.y - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0]) && (c = !c); | |
return c; | |
} | |
isPointInPoly([[1, 1], [5, 1], [5, 5], [1, 5]], {x: 2, y: 2}); //true | |
isPointInPoly([[1, 1], [5, 1], [5, 5], [1, 5]], {x: 100, y: 100}); //false |
================================ | |
The GeoJSON Format Specification | |
================================ | |
:Abstract: | |
GeoJSON is a geospatial data interchange format based on JavaScript Object | |
Notation (JSON). | |
:Authors: | |
Howard Butler (Hobu Inc.), |
console.log("got here"); | |
var page = require('webpage').create(); | |
page.onConsoleMessage = function(msg) { | |
console.log(msg); | |
}; | |
page.open("http://facebook.com", function(status) { | |
if ( status === "success" ) { |
<?php | |
/* | |
* Author: David T. Sadler (http://davidtsadler.com) | |
* Date: 2013-03-29 | |
* License: I release this example into the public domain. Use at your own risk. | |
* | |
* Example showing how to list an item to the eBay Sandbox using the eBay Accelerator Toolkit New Schema (EbatNS) for PHP. | |
* | |
* This example uses version 815 released on the 2013-03-22. | |
* http://www.intradesys.de/en/system/files/its_downloads/EbatNs_1_0_815_P5_0.zip |
One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.
Most workflows make the following compromises:
Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure
flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.
Use production SSL certificates locally. This is annoying
<?php | |
$navigation = Loader::helper('navigation'); | |
$c = Page::getCurrentPage(); | |
// get the attribute key by handle | |
$ak = CollectionAttributeKey::getByHandle('your_attribute_handle'); | |
// get the attribute type controller | |
$atc = $ak->getController(); | |
// check if the attibure type is select | |
if ($atc instanceOf SelectAttributeTypeController) { |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |