This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Format meaning: | |
| %a - The abbreviated weekday name (``Sun'') | |
| %A - The full weekday name (``Sunday'') | |
| %b - The abbreviated month name (``Jan'') | |
| %B - The full month name (``January'') | |
| %c - The preferred local date and time representation | |
| %d - Day of the month (01..31) | |
| %H - Hour of the day, 24-hour clock (00..23) | |
| %I - Hour of the day, 12-hour clock (01..12) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Geo = {}; | |
| Geo.positionOptions = { | |
| enableHighAccuracy: true, | |
| timeout: 5000, | |
| maximumAge: 30000 | |
| } | |
| Geo.error = function(positionError) { | |
| var code = positionError.code, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var aString = "sometext"; | |
| reversed = [].slice.call(aString).reverse().join(""); | |
| //outputs "txetemos" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ladumauifont = "data:;base64,AAEAAAANAIAAAwBQRkZUTWZFhywAABSYAAAAHEdERUYASgAGAAAUeAAAACBPUy8yT93diAAAAVgAAABWY21hcDxQKrgAAAIkAAABgmdhc3D//wADAAAUcAAAAAhnbHlm6m2p7QAAA+QAAA5QaGVhZP3fWLsAAADcAAAANmhoZWEEGf/9AAABFAAAACRobXR4NGIDdwAAAbAAAAB0bG9jYSoWLhIAAAOoAAAAPG1heHAAagCzAAABOAAAACBuYW1llh/W/wAAEjQAAAGPcG9zdAYWPZsAABPEAAAArAABAAAAAQAA/DFm718PPPUACwIAAAAAAM5eC/0AAAAAzl4L/f/9/98CBwHlAAAACAACAAAAAAAAAAEAAAHl/98ALgIA//3+AAIHAAEAAAAAAAAAAAAAAAAAAAAdAAEAAAAdALAACwAAAAAAAgAAAAEAAQAAAEAAAAAAAAAAAQH9AZAABQAIAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAIABQMAAAAAAAAAAAABEAAAAAAAAAAAAAAAUGZFZABAACHxZwHg/+AALgHlACGAAAABAAAAAAAAAgAAAAAAAAAAqgAAAAAAAAIAAAACAAAFAgAAAAIAAAACAADcAgAA3AIAADUCAP/+AgAAAAIAALECAACAAgAAAAIAAAACAAAAAgAAAgIAAAICAAANAgAAMAIAAAMCAP//AgAAAAIAAAICAAAFAgAABQG2AAcAAAADAAAAAwAAABwAAQAAAAAAfAADAAEAAAAcAAQAYAAAAAwACAACAAQAAAAw4AfwAPFn//8AAAAAACHgAPAA8Wf//wAAAAAgBBADDrUAAQAAAAoAAAAAAAAAAAANAAwADgAPABAAEQASABMAFAAVABYAFwAYABkAGgAbAAABBgAAAQAAAAAAAAABAgAAAAIAAAAAAAAAAAAAAAAAAAABAAAADQwODxAREhMUFRYXGBkaGwAAAAAAAAAAAAAAAAAAAAAAAAA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var batman = (function () { | |
| var identity = "Bruce Wayne"; | |
| return { | |
| fightCrime: function () { | |
| console.log("Cleaning up Gotham."); | |
| }, | |
| goCivilian: function () { | |
| console.log("Attend social events as " + identity); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo chown -R `whoami` ~/.npm | |
| sudo chown -R `whoami` /usr/local/lib/node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var person = { | |
| firstName :"Penelope", | |
| lastName :"Barrymore", | |
| showFullName:function () { | |
| // The "context" | |
| console.log (this.firstName + " " + this.lastName); | |
| } | |
| } | |
| // The "context", when invoking showFullName, is the person object, when we invoke the showFullName () method on the person object. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var box2 = document.getElementById("box2"); | |
| box2.insertAdjacentHTML('beforebegin', '<div><p>This gets inserted.</p></div>'); | |
| //beforebegin | |
| //The HTML would be placed immediately before the element, as a sibling. | |
| //afterbegin | |
| //The HTML would be placed inside the element, before its first child. | |
| //beforeend | |
| //The HTML would be placed inside the element, after its last child. | |
| //afterend |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var box = document.getElementById('box'), | |
| x, y, w; | |
| x = box.getBoundingClientRect().left; | |
| y = box.getBoundingClientRect().top; | |
| w = box.getBoundingClientRect().width; //|| box.offsetWidth; | |
| h = box.getBoundingClientRect().height; // || box.offsetHeight; | |
| console.log(x, y, w, h); |