// jQuery
$(document).ready(function() {
// code
})
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
Lesson 1 - Iterations | |
- BinaryGap - https://codility.com/demo/results/trainingU2FQPQ-7Y4/ | |
Lesson 2 - Arrays | |
- OddOccurrencesInArray - https://codility.com/demo/results/trainingFN5RVT-XQ4/ | |
- CyclicRotation - https://codility.com/demo/results/trainingSH2W5R-RP5/ | |
Lesson 3 - Time Complexity | |
- FrogJmp - https://codility.com/demo/results/training6KKWUD-BXJ/ | |
- PermMissingElem - https://codility.com/demo/results/training58W4YJ-VHA/ |
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 | |
/* | |
|-------------------------------------------------------------------------- | |
| Application Routes | |
|-------------------------------------------------------------------------- | |
| | |
| Here is where you can register all of the routes for an application. | |
| It's a breeze. Simply tell Laravel the URIs it should respond to | |
| and give it the controller to call when that URI is requested. |
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
/*global define*/ | |
define( | |
function() | |
{ | |
var i; | |
var len; | |
var multiplicator = 20; | |
var count; | |
var rgba; |
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 getAverageColor = (function(window, document, undefined){ | |
return function(imageURL, options}){ | |
options = { | |
// image split into blocks of x pixels wide, 1 high | |
blocksize: options.blocksize || 5, | |
fallbackColor: options.fallbackColor || '#000' | |
}; | |
var img = document.createElement('img'), | |
canvas = document.createElement('canvas'), |
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 getAverageColourAsRGB (img) { | |
var canvas = document.createElement('canvas'), | |
context = canvas.getContext && canvas.getContext('2d'), | |
rgb = {r:102,g:102,b:102}, // Set a base colour as a fallback for non-compliant browsers | |
pixelInterval = 5, // Rather than inspect every single pixel in the image inspect every 5th pixel | |
count = 0, | |
i = -4, | |
data, length; | |
// return the base colour for non-compliant browsers |