Skip to content

Instantly share code, notes, and snippets.

View iamanas20's full-sized avatar
🎯
Focusing

Anas Latique iamanas20

🎯
Focusing
  • Utrecht, Netherlands
  • 18:02 (UTC +02:00)
  • X @achxvi
View GitHub Profile
@iamanas20
iamanas20 / simple-canvas-rotation.html
Created June 8, 2021 09:15 — forked from geoffb/simple-canvas-rotation.html
A simple example of rotating a rectangle using HTML5 canvas.
<!DOCTYPE html>
<html>
<head>
<title>HTML5 Canvas Transformation</title>
</head>
<body>
<script>
// Create our canvas and append it to the document body
var stage = document.createElement("canvas");
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
@iamanas20
iamanas20 / reduce-example.js
Created January 10, 2020 22:35 — forked from benwells/reduce-example.js
Using Array.reduce to sum a property in an array of objects
var accounts = [
{ name: 'James Brown', msgCount: 123 },
{ name: 'Stevie Wonder', msgCount: 22 },
{ name: 'Sly Stone', msgCount: 16 },
{ name: 'Otis Redding', msgCount: 300 } // Otis has the most messages
];
// get sum of msgCount prop across all objects in array
var msgTotal = accounts.reduce(function(prev, cur) {
return prev + cur.msgCount;