Skip to content

Instantly share code, notes, and snippets.

View wwwmarcos's full-sized avatar

Marcos Florencio wwwmarcos

View GitHub Profile
@Configuration
@EnableWebMvc
public class WebConfig extends WebMvcConfigurerAdapter {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("*")
.allowedMethods("PUT", "DELETE", "POST", "GET")
.allowCredentials(false)
(function() {
'use strict'
angular
.module('alabama', [])
.component('alabama', {
template: 'transclude.component.html',
controller: AlabamaComponentController,
transclude: {
'title': '?alabamaTitle',
(function() {
'use strict'
angular
.module('alabama', [])
.component('alabama', {
template: 'transclude.component.html',
controller: AlabamaComponentController,
transclude: true
})
(function() {
'use strict'
angular
.module('alabama', [])
.component('alabama', {
template: '{{message}} {{otherMessage}}',
controller: AlabamaComponentController,
bindings: {
message: '@',
var promises = [];
for(var i = 0; i < 5; i++) {
var promise = $http.get('/data' + i);
promises.push(promise);
}
$q.all(promises).then(doSomethingAfterAllRequests)
(function() {
'use strict'
angular
.module('LocalStorageServices', [])
.factory('LocalStorageService', LocalStorageService)
LocalStorageService.$inject = ['$cookies']
function LocalStorageService($cookies) {
var factory = {
const gulp = require('gulp'),
concat = require('gulp-concat'),
stylus = require('gulp-stylus'),
browserSync = require('browser-sync'),
cssmin = require('gulp-cssmin'),
rename = require('gulp-rename'),
reload = browserSync.reload
const paths = {
src: {
alert('Hello Word')
/**
* Slim container based on container of bootstrap
*/
.container-slim {
padding-right: 15px;
padding-left: 15px;
margin-right: auto;
margin-left: auto;
}
@media (min-width: 768px) {
(function() {
'use strict';
angular
.module('ExceptionHandler', [])
.factory('$exceptionHandler', exceptionHandler);
exceptionHandler.$inject = ['message', '$log']
function exceptionHandler(message, $log){
return function handle(exception, cause){