This is a work-in-progress cheatsheet for JS arrays. Please feel free to leave a comment if this has helped you or you would like to suggest anything.
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
app.run ($rootScope, $state, SessionService, $window) -> | |
$rootScope.$state = $state | |
$rootScope.logout = -> SessionService.logout true | |
win = $($window) | |
scrollTime = 0.3 | |
scrollDistance = 200 | |
win.on 'mousewheel DOMMouseScroll', (evt) -> | |
evt.preventDefault() |
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
angular.module 'directives' | |
### Usage: | |
<div | |
parallax-background | |
parallax-background-ratio="0.6" | |
parallax-background-src="assets/image.png" | |
parallax-background-gradient="linear-gradient(rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.4) 100%)"> | |
</div> | |
### |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
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
gulp.task 'connect', [], -> connect.server | |
root: ['build'] | |
port: 9000 | |
livereload: true | |
middleware: (connect, opt) -> [ | |
historyApiFallback = (req, res, next) -> | |
headers = req.headers | |
rewriteTarget = '/index.html' | |
appBaseDir = 'build' |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
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
/* | |
Copyright (c) 2011 Andrei Mackenzie | |
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: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE |
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
function Deferred() { | |
var resolve, reject; | |
var promise = new Promise((resolver, rejector) => { | |
resolve = resolver; | |
reject = rejector; | |
}); | |
return { | |
promise, | |
resolve, | |
reject |
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 http = require('http'); | |
var requests = process.argv.slice(2); | |
var results = []; | |
var count = 0; | |
for (var i = 0, len = requests.length; i < len; i++) { | |
getRequest(requests[i], i); | |
} |
OlderNewer