Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
PHP Laravel Developer, learning ReactJS, Blockchain certified

Amit Shah amitshahc

💭
PHP Laravel Developer, learning ReactJS, Blockchain certified
  • Vadodara
View GitHub Profile
@lalkmim
lalkmim / codility_solutions.txt
Last active Sep 9, 2021
Codility Solutions in JavaScript
View codility_solutions.txt
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/
View lumen-resource-route.php
<?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.
@joyrexus
joyrexus / README.md
Last active Sep 10, 2021 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods
View README.md

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@snorpey
snorpey / average-rgba.js
Created Jul 13, 2013
get average color of an imagedata object (from an html5 canvas) in javascript
View average-rgba.js
/*global define*/
define(
function()
{
var i;
var len;
var multiplicator = 20;
var count;
var rgba;
@fuzzyfox
fuzzyfox / average-color.js
Last active Aug 31, 2020
JavaScript: image average color
View average-color.js
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'),
@olvado
olvado / getAverageColourAsRGB.js
Created Jun 27, 2011
Get the average colour of an image in javascript using getImageData in CANVAS
View getAverageColourAsRGB.js
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