Skip to content

Instantly share code, notes, and snippets.

View minaorangina's full-sized avatar

Mina minaorangina

  • London
View GitHub Profile
@minaorangina
minaorangina / myClass.js
Created June 9, 2017 13:08
Private variables in ES6 classes
// One approach for having private properties.
// Useful if you have 'sensitive' data that you would rather not be directly accessible by anyone
class MyClass {
constructor (data) {
let _data = data;
this.setData = function (newData) {
_data = newData;
@minaorangina
minaorangina / alternativeOnLoad.js
Last active June 13, 2017 21:11
No JQuery: $(document).ready equivalent
// Should work with all modern browsers. Very old IE versions may not.
if (document.readyState !== 'loading') {
ready();
} else {
document.addEventListener('DOMContentLoaded', ready);
}
function ready () {
}
@minaorangina
minaorangina / LICENSE
Last active August 29, 2015 14:27 — forked from ourmaninamsterdam/LICENSE
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions: