Skip to content

Instantly share code, notes, and snippets.

View esayler's full-sized avatar

Eric Sayler esayler

View GitHub Profile

JavaScript Notes

  • sources: MDN, google/airbnb style guides

Comments

/// a one line comment

/* a mutli-
var Year = function(input) {
this.input = input;
};
Year.prototype.isLeap = function() {
if (this.input % 4 === 0) {
if (this.input % 100 === 0) {
if (this.input % 400 === 0) {
return true;
var Year = require('./leap');
describe('Leap year', function() {
it('is not very common', function() {
var year = new Year(2015);
expect(year.isLeap()).toBe(false);
});
it('is introduced every 4 years to adjust about a day', function() {
@esayler
esayler / leap-closure.js
Last active October 15, 2016 15:47
leap-closure.js
var Year = function(input) {
Year.prototype.isLeap = function() {
if (input % 4 === 0) {
if (input % 100 === 0) {
if (input % 400 === 0) {
return true;
} else {
return false;
@esayler
esayler / es-css-challenges.md
Last active October 16, 2016 15:28 — forked from LouisaBarrett/css-challenges-template.md
CSS Layout Challenges - 1610FE - Eric Sayler

CSS Layout Challenges - 1610FE - Eric Sayler

TODO:

  • complete Challenges 1-15
  • refactor to make solutions more responsive
  • refactor to make less use of position: absolute;

Solutions:

Accessibility Commitments

1. Visual + Cognition

Consistent Clean Design

Use a consistent, simple, clean design to reduce cognitive load and make your site easily navigable and easy to use

  • Use lots of white space, keep design uncluttered
  • Use few fonts, black text on white background (high contrast) to make easier to read for dyslexics
function List() {
this.head = null;
this.tail = null;
this._length = 0;
};
List.prototype.push = function(data) {
var newNode = new ListNode(data);
if (this.head === null && this.tail === null) {
this.head = newNode;
request
.get(url)
.pipe(fs.createWriteStream(path))
.on('close', callback)
let stream = progress({ time: 50 })
stream.on('progress', progress => {
mainWindow.setProgressBar(progress.percentage / 100.0)
})
request
.get(url)
.pipe(stream)
.pipe(fs.createWriteStream(path))