var obj = {
handleEvent: function() {
alert(this.dude);
},
dude: "holla"
};
###:reg To see all of the current registers tha are in use.
- '*' register is system clipboard
- '.' register stores what just typed , it's read-only.
- typing 'yy' will 'yank' this line .
- type ':reg' will show the 'yank' line in register 0
###Unnamed Register 1.'""'register will show the delete element. 2.'0' register will always show the last yank command. 3.p will put delete element rather than the yank element.
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
| document.activeElement.blur(); |
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 jzhg = (function(){ | |
| let navDom = document.querySelector('.zyee-jzhg-nav'); | |
| let nav = $('.zyee-jzhg-nav'); | |
| let navWidth = nav.width(), | |
| domWidth = $(document).width(), | |
| maxTransformX = navWidth - domWidth; | |
| let touchStartX, | |
| touchMoveX, | |
| moveX, |
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
| /* From Modernizr */ | |
| function whichTransitionEvent(){ | |
| var t; | |
| var el = document.createElement('fakeelement'); | |
| var transitions = { | |
| 'transition':'transitionend', | |
| 'OTransition':'oTransitionEnd', | |
| 'MozTransition':'transitionend', | |
| 'WebkitTransition':'webkitTransitionEnd' | |
| } |
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
| //Internet Explorer 5.5+ | |
| body, html { /* these are default, can be replaced by hex color values */ | |
| scrollbar-base-color: aqua; | |
| scrollbar-face-color: ThreeDFace; | |
| scrollbar-highlight-color: ThreeDHighlight; | |
| scrollbar-3dlight-color: ThreeDLightShadow; | |
| scrollbar-shadow-color: ThreeDDarkShadow; | |
| scrollbar-darkshadow-color: ThreeDDarkShadow; | |
| scrollbar-track-color: Scrollbar; |
/* style.css */ body { background: red; }
/* entry.js */ require("./style.css"); document.write("");
npm install webpack webpack-dev-server -g
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
| import {expect} from 'chai'; | |
| import {List, Map} from 'immutable'; | |
| //set Entries function | |
| function setEntries(state, entries){ | |
| return state.set('entries', List(entries)); | |
| } | |
| //get Winners | |
| function getWinners(vote){ | |
| if (!vote) return []; |
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
| // Flyweight.js - Copyright Addy Osmani, 2012. | |
| // Consider public domain | |
| // My implementation in JS of this: | |
| // http://en.wikipedia.org/wiki/Flyweight_pattern | |
| // Simulate pure virtual inheritance/'implement' keyword for JS | |
| Function.prototype.implementsFor = function (parentClassOrObject) { | |
| if (parentClassOrObject.constructor == Function) { | |
| // Normal Inheritance | |
| this.prototype = new parentClassOrObject; |