Skip to content

Instantly share code, notes, and snippets.

View evolutionxbox's full-sized avatar
👀
Trying my hardest

Jonathan Cousins evolutionxbox

👀
Trying my hardest
View GitHub Profile
@evolutionxbox
evolutionxbox / generateUniqueID.js
Created June 13, 2017 09:01
Simple Unique ID Generator (well, not entirely unique...)
function generateUniqueID() {
function chr4(){
return Math.random().toString(16).slice(-4);
}
return chr4() + chr4() +
'-' + chr4() +
'-' + chr4() +
'-' + chr4() +
'-' + chr4() + chr4() + chr4();
}
@evolutionxbox
evolutionxbox / simpleSerializeFormData.js
Created June 23, 2017 12:04
Simple Serialize Form Data
// Serialize form data
function serialize (form) {
return [...form.elements]
.filter(element => element.type !== 'radio' || element.checked)
.map(element => element.name + '=' + encodeURIComponent(element.value))
.join('&');
}
@evolutionxbox
evolutionxbox / classNameToSelector.js
Created October 26, 2017 08:58
Takes className(s) and converts it to a CSS string (although a little buggy)
/**
* "foo bar baz", "bar foo moo" -> ".foo.bar.baz .bar.foo.moo"
* @param {String...} classString
* @return {String}
*/
module.exports = function classNameToSelector(classString) {
var selector = [];
for (var i = 0, len = arguments.length; i < len; i++) {
selector.push(_classNameToSelector(arguments[i]));
}
@evolutionxbox
evolutionxbox / Quick-FED-Interview-Questions.md
Last active January 29, 2018 15:56
Quick Front-end Interview Questions

General

  1. Describe three ways to test accessibility?
  2. How would you approach fixing browser-specific styling issues?
  3. In what ways can a websites loading performance be improved?

HTML

  1. Have you used different HTML templating languages before?
  2. Describe at least one way you check the accessibility of written HTML?

CSS