The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.
Send messages to iframe using iframeEl.contentWindow.postMessage
Recieve messages using window.addEventListener('message')
| inline void HSI2RGB(double h, double s, double i, double* r, double* g, double* b) | |
| { | |
| double x = i * (1 - s); | |
| if(h < 2 * M_PI / 3) | |
| { | |
| double y = i * (1 + (s * cos(h)) / (cos(M_PI / 3 - h))); | |
| double z = 3 * i - (x + y); | |
| *b = x; *r = y; *g = z; | |
| } | |
| else if(h < 4 * M_PI / 3) |
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
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
| This is free and unencumbered software released into the public domain. | |
| Anyone is free to copy, modify, publish, use, compile, sell, or | |
| distribute this software, either in source code form or as a compiled | |
| binary, for any purpose, commercial or non-commercial, and by any | |
| means. | |
| In jurisdictions that recognize copyright laws, the author or authors | |
| of this software dedicate any and all copyright interest in the | |
| software to the public domain. We make this dedication for the benefit |
| $(function() { | |
| // Tweaked from: https://gist.github.com/mattstauffer/3835881 | |
| // No guarantees | |
| // 1. include Isotope.js | |
| // 2. include this file | |
| // 3. customize Isotope options at the bottom of this file | |
| // 4. add "margin: 0 auto" to the isotope container | |
| $.Isotope.prototype._getMasonryGutterColumns = function() { |
| Ort;Zusatz;Plz;Vorwahl;Bundesland | |
| Aach;b Trier;54298;0651;Rheinland-Pfalz | |
| Aach;, Hegau;78267;07774;Baden-Württemberg | |
| Aachen;;52062;0241;Nordrhein-Westfalen | |
| Aachen;;52064;0241;Nordrhein-Westfalen | |
| Aachen;;52066;0241;Nordrhein-Westfalen | |
| Aachen;;52068;0241;Nordrhein-Westfalen | |
| Aachen;;52070;0241;Nordrhein-Westfalen | |
| Aachen;;52072;0241;Nordrhein-Westfalen | |
| Aachen;;52074;0241;Nordrhein-Westfalen |
The [RFC for a new simple to use password hashing API][rfc] has just been accepted for PHP 5.5. As the RFC itself is rather technical and most of the sample codes are something you should not use, I want to give a very quick overview of the new API:
Everybody knows that you should be hashing their passwords using bcrypt, but still a surprising number of developers uses insecure md5 or sha1 hashes (just look at the recent password leaks). One of the reasons for this is that the crypt() API is ridiculously hard to use and very prone to programming mistakes.
| [ | |
| {name: 'Afghanistan', code: 'AF'}, | |
| {name: 'Åland Islands', code: 'AX'}, | |
| {name: 'Albania', code: 'AL'}, | |
| {name: 'Algeria', code: 'DZ'}, | |
| {name: 'American Samoa', code: 'AS'}, | |
| {name: 'AndorrA', code: 'AD'}, | |
| {name: 'Angola', code: 'AO'}, | |
| {name: 'Anguilla', code: 'AI'}, | |
| {name: 'Antarctica', code: 'AQ'}, |