Skip to content

Instantly share code, notes, and snippets.

View SinghCoder's full-sized avatar
🎯
Focusing

Harpinder SinghCoder

🎯
Focusing
View GitHub Profile
@SinghCoder
SinghCoder / email_dreamcode.js
Created September 24, 2018 10:01 — forked from gr2m/email_dreamcode.js
Imagine you could send emails with JavaScript, multipart, and with attachments?! How would the code look like? This is what I came up with. Forks & comments much appreciated! #nobackend #dreamcode
// send text email
sendEmail({
subject: "Hello, World!",
text: "This mail has been sent from the frontend",
to: "joe@exam.pl"
})
// send multipart text / html email
sendEmail({
subject: "Hello, World!",
@SinghCoder
SinghCoder / gist:2550d1c229ffd259ef16e75865f8e9ce
Created July 22, 2018 05:25 — forked from snowman-repos/gist:3825198
JavaScript: Detect Orientation Change on Mobile Devices
// Listen for orientation changes
window.addEventListener("orientationchange", function() {
// Announce the new orientation number
alert(window.orientation);
}, false);
// Listen for resize changes
window.addEventListener("resize", function() {
// Get screen size (inner/outerWidth, inner/outerHeight)