Skip to content

Instantly share code, notes, and snippets.

View lostandfownd's full-sized avatar

Alexandru Dragos lostandfownd

View GitHub Profile
@lostandfownd
lostandfownd / README.md
Created November 7, 2018 20:33 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@lostandfownd
lostandfownd / samplerest.js
Created June 28, 2018 11:29 — forked from joshbirk/samplerest.js
Sample of using passport w/ mult strategies
var fs = require("fs")
var ssl_options = {
key: fs.readFileSync('privatekey.pem'),
cert: fs.readFileSync('certificate.pem')
};
var port = process.env.PORT || 3000;
var express = require('express');
var ejs = require('ejs');
var passport = require('passport')
// Brightness math based on:
// http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx
$red-magic-number: 241;
$green-magic-number: 691;
$blue-magic-number: 68;
$brightness-divisor: $red-magic-number + $green-magic-number + $blue-magic-number;
@function brightness($color) {
// Extract color components