Skip to content

Instantly share code, notes, and snippets.

View javaeeeee's full-sized avatar

Dmitry Noranovich javaeeeee

View GitHub Profile
@javaeeeee
javaeeeee / script.js
Created December 16, 2016 23:10
Using IIFE to remove AngularJS variables and methods from the global scope
(function () {
angular.module('app', [])
.controller('HelloController', HelloController);
HelloController.$inject = ['$scope'];
function HelloController($scope) {
$scope.myModel = 'World';
}
@javaeeeee
javaeeeee / script.js
Created December 16, 2016 22:48
Using $inject to manually identify the dependencies for an AngularJS component
angular.module('app', [])
.controller('HelloController', HelloController);
HelloController.$inject = ['$scope'];
function HelloController($scope) {
$scope.myModel = 'World';
@javaeeeee
javaeeeee / script.js
Created December 16, 2016 22:43
AngularJS in-line dependency to safeguard from minification
angular.module('app', [])
.controller('HelloController', ['$scope', HelloController]);
@javaeeeee
javaeeeee / index.html
Created December 16, 2016 22:38
An HTML file with module and controller added
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hello World AngularJS application</title>
<script data-require="[email protected]" data-semver="1.6.0" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.0/angular.js"></script>
<script src="script.js"></script>
</head>
@javaeeeee
javaeeeee / script.js
Created December 16, 2016 22:28
A code to create an AngularJS module and add a controller
angular.module('app', [])
.controller('HelloController', HelloController);
function HelloController($scope) {
$scope.myModel = 'World';
}
@javaeeeee
javaeeeee / index.html
Created December 16, 2016 22:22
A snippet of HTML code with AngularJS added using script tag and ng-model directive is used
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hello World AngularJS application</title>
<script data-require="[email protected]" data-semver="1.6.0" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.0/angular.js"></script>
</head>
<body ng-app>
@javaeeeee
javaeeeee / index.html
Created December 16, 2016 22:19
A snippet of HTML code used to create a Hello World AngularJS application
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hello World AngularJS application</title>
</head>
<body>
<h1>Hello World AngularJS application</h1>
@javaeeeee
javaeeeee / latest.json
Created December 4, 2015 07:05
An excerpt from currency exchange rate data returned by Open Exchange Rates API
{
"disclaimer": "Exchange rates are provided for informational purposes only, and do not constitute financial advice of any kind. Although every attempt is made to ensure quality, NO guarantees are given whatsoever of accuracy, validity, availability, or fitness for any purpose - please use at your own risk. All usage is subject to your acceptance of the Terms and Conditions of Service, available at: https://openexchangerates.org/terms/",
"license": "Data sourced from various providers with public-facing APIs; copyright may apply; resale is prohibited; no warranties given of any kind. Bitcoin data provided by http://coindesk.com. All usage is subject to your acceptance of the License Agreement available at: https://openexchangerates.org/license/",
"timestamp": 1449208861,
"base": "USD",
"rates": {
"AED": 3.672912,
"AFN": 66.879999,
"ALL": 126.962099,
"AMD": 484.589999,
@javaeeeee
javaeeeee / currencies.json
Created December 4, 2015 07:04
An excerpt from currencies list from Open Exchange Rates API
{
"AED": "United Arab Emirates Dirham",
"AFN": "Afghan Afghani",
"ALL": "Albanian Lek",
"AMD": "Armenian Dram",
"ANG": "Netherlands Antillean Guilder",
"AOA": "Angolan Kwanza",
"ARS": "Argentine Peso",
"AUD": "Australian Dollar",
"AWG": "Aruban Florin",
public class DWGettingStartedApplication
extends Application<DWGettingStartedConfiguration> {
...
@Override
public void run(final DWGettingStartedConfiguration configuration,
final Environment environment) {
...
//Create Jersey client.