Skip to content

Instantly share code, notes, and snippets.

@fabioyamate
Last active February 20, 2016 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabioyamate/2884873 to your computer and use it in GitHub Desktop.
Save fabioyamate/2884873 to your computer and use it in GitHub Desktop.
jQuery, AngularJS snippet to start working
# Add an alias to your .bash_profile
#
# alias sjquery='curl https://raw.github.com/gist/2884873/jquery.html -L -o'
# alias sangular='curl https://raw.github.com/gist/2884873/angular.html -L -o'
#
# Updates:
# * using http://rawgithub.com service to include files directly from server
#
# Usage
#
# $ sjquery my_file.html
#
# If you prefer to use protocol agnostic, you have to run files in a server.
#
# Recommend to use Python simple server
#
# $ python -m SimpleHTTPServer 8080
<!doctype html>
<html lang="en" ng-app>
<head>
<meta charset="utf-8">
<title>Angular JS Snippet</title>
<link rel="stylesheet" href="http://rawgithub.com/necolas/normalize.css/master/normalize.css">
<script src="http://rawgithub.com/LeaVerou/prefixfree/gh-pages/prefixfree.min.js"></script>
</head>
<body ng-controller="HelloController">
<div id="container">
{{message}}
</div>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script>
<script src="http://underscorejs.org/underscore-min.js"></script>
<script>
function HelloController($scope) {
$scope.message = 'Hello World';
}
</script>
</body>
</html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery Snippet</title>
<link rel="stylesheet" href="http://rawgithub.com/necolas/normalize.css/master/normalize.css">
<script src="http://rawgithub.com/LeaVerou/prefixfree/gh-pages/prefixfree.min.js"></script>
</head>
<body>
<div id="container"></div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="http://underscorejs.org/underscore-min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore-contrib/0.1.4/underscore-contrib.min.js"></script>
<script>
$(function($) {
// do your code
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment