Skip to content

Instantly share code, notes, and snippets.

View Sensational-Code's full-sized avatar
:shipit:
Being sensational

Sensational Code Sensational-Code

:shipit:
Being sensational
View GitHub Profile
@Sensational-Code
Sensational-Code / imageToBlob.js
Created September 26, 2018 01:50
Convert image to blob
function imageToBlob(image) {
// Create a canvas to render the image on
var canvas = document.createElement('canvas');
canvas.width = image.width;
canvas.height = image.height;
// Create a context and render the image
var ctx = canvas.getContext('2d');
ctx.drawImage(image, 0, 0, image.width, image.height);
@Sensational-Code
Sensational-Code / monthAndWeekday.js
Last active July 31, 2018 10:10
Get Month and Weekday
var date = new Date();
var locale = 'en-us';
var month = date.toLocaleString(locale, {month: 'long'});
var weekday = date.toLocaleString(locale, {weekday: 'long'});