This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var p1 = { | |
x: 20, | |
y: 20 | |
}; | |
var p2 = { | |
x: 40, | |
y: 40 | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'[email protected] :do not modify this line - see ramblings.mcpher.com for details: updated on 28/02/2013 09:55:55 : from manifest:3414394 gist https://gist.github.com/brucemcpherson/3414615/raw | |
' this is all about colors | |
Option Explicit | |
' v2.7 3414615 | |
Public Type colorProps | |
' this is a single type to hold everything i know how to calculate about a color | |
rgb As Long | |
red As Long | |
green As Long |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
function rgbToHsl( $r, $g, $b ) { | |
$oldR = $r; | |
$oldG = $g; | |
$oldB = $b; | |
$r /= 255; | |
$g /= 255; | |
$b /= 255; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Converts an RGB color value to HSL. Conversion formula | |
* adapted from http://en.wikipedia.org/wiki/HSL_color_space. | |
* Assumes r, g, and b are contained in the set [0, 255] and | |
* returns h, s, and l in the set [0, 1]. | |
* | |
* @param Number r The red color value | |
* @param Number g The green color value | |
* @param Number b The blue color value | |
* @return Array The HSL representation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Content from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes | |
* | |
* You may also want a list of unofficial codes: | |
* | |
* 103 => 'Checkpoint', | |
* 218 => 'This is fine', // Apache Web Server | |
* 419 => 'Page Expired', // Laravel Framework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get the average pixel colour from the given file using Image Magick | |
* | |
* @param string $filename | |
* @param bool $as_hex Set to true, the function will return the 6 character HEX value of the colour. | |
* If false, an array will be returned with r, g, b components. | |
*/ | |
function get_average_colour($filename, $as_hex_string = true) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="container"> | |
This is the | |
<div id="caption"> | |
<span>best</span> | |
<span>ultimate</span> | |
<span>excellent</span> | |
<span>fantastic</span> | |
</div> | |
website in town. | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Liang-Barsky function by Daniel White | |
* | |
* @link http://www.skytopia.com/project/articles/compsci/clipping.html | |
* | |
* @param {number} x0 | |
* @param {number} y0 | |
* @param {number} x1 | |
* @param {number} y1 | |
* @param {array<number>} bbox |
Until recently, the Google Home app used to communicate with the device over port 8008 (HTTP) and did not require any authentication. Everything in the unofficial documentation worked as expected.
A few days (weeks) ago, Google pushed a new update to all GH devices and all endpoints (except /setup/eureka_info
) started returning 403 (forbidden) errors. The app had switched over to port 8443 and HTTPS.
OlderNewer