This file contains 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
<!DOCTYPE html> | |
<html ng-app="app"> | |
<head> | |
<meta name="description" content="Angular Promises Example"> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script> | |
<meta charset="utf-8"> | |
<title>Angular Promises Example</title> | |
</head> | |
<body ng-controller="MessageCtrl"> | |
<h1>Angular Promises Example</h1> |
This file contains 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
<!DOCTYPE html> | |
<html ng-app="app"> | |
<head> | |
<script src="https://cdn.rawgit.com/lodash/lodash/3.0.1/lodash.min.js"></script> | |
<script src="https://rawgit.com/angular/bower-angular/master/angular.min.js"></script> | |
<meta charset="utf-8"> | |
<title>JavaScript Filter, Map and ForEach Example</title> | |
</head> | |
<body> | |
This file contains 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
<!DOCTYPE html> | |
<html data-ng-app="TestApp"> | |
<head> | |
<script src="http://code.angularjs.org/1.2.9/angular.js"></script> | |
<script> | |
angular.module('TestApp', []) | |
.factory('beforeUnload', function ($rootScope, $window) { | |
// Events are broadcast outside the Scope Lifecycle |
This file contains 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
'use strict'; | |
angular.module('Component', []) | |
.factory('Component', function () { | |
return function(bindings, template, linkFn, options) { | |
var directive = { | |
scope: parseBindings(bindings), | |
template: parseTemplate(template), | |
link: linkFn |
This file contains 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 parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
This file contains 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
/** | |
* Parse query string. | |
* ?a=b&c=d to {a: b, c: d} | |
* @param {String} (option) queryString | |
* @return {Object} query params | |
*/ | |
getQueryParams: function(queryString) { | |
var query = (queryString || window.location.search).substring(1); // delete ? | |
if (!query) { | |
return false; |
This file contains 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
#!/bin/bash | |
# Authorize TCP, SSH & ICMP for default Security Group | |
#ec2-authorize default -P icmp -t -1:-1 -s 0.0.0.0/0 | |
#ec2-authorize default -P tcp -p 22 -s 0.0.0.0/0 | |
# The Static IP Address for this instance: | |
IP_ADDRESS=$(cat ~/.ec2/ip_address) | |
# Create new t1.micro instance using ami-cef405a7 (64 bit Ubuntu Server 10.10 Maverick Meerkat) |
This file contains 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
[user] | |
name = Pavan Kumar Sunkara | |
email = [email protected] | |
[core] | |
editor = vim | |
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
excludesfile = ~/.gitignore | |
[sendemail] | |
smtpencryption = tls | |
smtpserver = smtp.gmail.com |
This file contains 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
// tiny template engine function | |
function tpl(str,obj) { | |
for(var key in obj) { | |
str=str.replace(new RegExp('{' + key + '}','g'), obj[key]); | |
} | |
return str; | |
} | |
// code example | |
console.clear(); |
This file contains 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
// Reference from: https://github.com/Reactive-Extensions/RxJS/blob/master/doc/howdoi/eventemitter.md | |
var hasOwnProp = {}.hasOwnProperty; | |
function createName (name) { | |
return '$' + name; | |
} | |
function Emitter() { | |
this.subjects = {}; |
OlderNewer