Skip to content

Instantly share code, notes, and snippets.

@loomismilitia
loomismilitia / AngularJS-sharing-scope-data-between-controllers.html
Last active September 3, 2017 09:27 — forked from pmanijak/index.html
Service example with AngularJS for sharing scope data between controllers
<!doctype html>
<html ng-app="project">
<head>
<title>Angular: Service example</title>
<script src="http://code.angularjs.org/angular-1.0.1.js"></script>
<script>
var projectModule = angular.module('project',[]);
projectModule.factory('theService', function() {
return {
@loomismilitia
loomismilitia / UTF8Control.java
Last active May 10, 2017 10:21 — forked from DemkaAge/UTF8Control.java
ResourceBundle UTF-8 Control class
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.Locale;
import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;
@loomismilitia
loomismilitia / application.properties
Last active September 5, 2017 17:12
Spring Boot common application.properties
# Common application properties
# https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
# Embedded Server Configuration
server.port = 9000
# Management HTTP Server
#
@loomismilitia
loomismilitia / JDK 1.6 Installation in Ubuntu
Created September 3, 2017 09:09 — forked from senthil245/JDK 1.6 Installation in Ubuntu
Step by step installation of JDK 1.6 in Ubuntu
Install Java JDK 6.0 update 31 on Ubuntu 12.04 LTS
Introduction
The first question is why are we installing an old JDK. The answer is that Oracle JDK 6.0 update 31 is the JDK recommended by Cloudera when installing CDH4 (Cloudera Distribution Hadoop v4).
This is an update to an older version of this post. Mainly I have changed the JDK from 1.6.0_26 to 1.6.0_31 as this is the recommended JDK for CDH4 .
Install Java
I have a 64 bit version of Ubuntu 12.04 LTS installed, so the instructions below only apply to this OS.
@loomismilitia
loomismilitia / ResponsibilityTypeRepository.java
Last active September 20, 2017 14:33
Spring Data Rest - @RepositoryRestResource - Block CRUD operations
package com.sample;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import org.springframework.data.rest.core.annotation.RestResource;
/**
* This repository provides CRUD operations for {@link ResponsibilityType} objects.
* https://docs.spring.io/spring-data/rest/docs/2.2.2.RELEASE/reference/html/#repository-resources.collection-resource
*/
@MappedSuperclass
public abstract class AbstractAuditable<U, PK extends Serializable> extends AbstractPersistable<PK> implements
Auditable<U, PK> {
// …
}
@loomismilitia
loomismilitia / ExpressionDrivenDependencyInjection.java
Created October 24, 2017 09:43
Spring Boot - Expression Driven Dependency Injection
public class ExpressionDrivenDependencyInjection {
@Value("${file.root.folder}")
private String rootFolder;
@Value("${file.pictures.folder}")
private String picturesFolder;
}
drop procedure if exists doWhile;
SET @counter=5000;
CREATE PROCEDURE doWhile()
BEGIN
DECLARE i INT DEFAULT 0;
WHILE (i <= @counter) DO
INSERT INTO `test` (name) values ('loop sample');
SET i = i+1;
@loomismilitia
loomismilitia / wysiwyg.utils.js
Last active April 26, 2018 16:13
Angular WYSIWYG utils
/**
* WYSIWYG utils
*
* @namespace WYSIWYGUtils
*/
(function() {
"use strict";
angular