Usage:package org.catcher.example.boostedenum; import org.catcher.example.boostedenum.some.SomeRepository; import org.catcher.example.boostedenum.some.SomeService; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; public class Main { public static void main(String[] args) { SomeRepository repo = mock(SomeRepository.class); when(repo.getFactor()).thenReturn( »

Install python and pip# Python 2 sudo apt-get install python sudo apt-get install python-pip # Python 3 sudo apt-get install python3 sudo apt-get install python3-pip Install pipenvpip3 install pipenvInstall virtualenvpip3 install virtualenv »

Google Vision https://www.linkedin.com/pulse/google-vision-api-receipt-ocr-denny-muktar OCR library https://asprise.com/royalty-free-library/java-ocr-barcode-reader-sdk-samples-docs.html »

https://www.godaddy.com/garage/how-to-make-a-minecraft-server/ »

https://bitbucket.org/catchers/atomikos-distributed-transactions/src/master/ AppConfig.java package org.catcher.sandbox.learningspring.config; import javax.sql.DataSource; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.jta.atomikos.AtomikosDataSourceBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation. »

When to use Static Class in place of Singleton in Java Indeed there are some situations, where static classes makes sense than Singleton. Prime example of this is java.lang.Math which is not Singleton, instead a class with all static methods. Here are few situation where I think using »

nano ~/.local/share/applications/jetbrains-idea-ce.desktop and update file: [Desktop Entry] Version=1.0 Type=Application Name=IntelliJ IDEA Community Edition Icon=/opt/idea-IC-171.4694.70/bin/idea.png Exec="/opt/idea-IC-171.4694.70/bin/idea.sh" %f Comment=The Drive to Develop Categories=Development;IDE; Terminal=false »

Source: https://rombertw.wordpress.com/2010/05/20/maven-recipe-delivering-applications-as-rpms/ »

Installation of NVM sudo apt-get update sudo apt-get install build-essential libssl-dev curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh -o install_nvm.sh bash install_nvm.sh source ~/.profile Listing remote node.js versions: nvm ls-remote If you have multiple Node.js versions, you can »

Run stack su - stack # passwod: stack cd ~/devstack ./stack.sh Unstack su - stack # passwod: stack cd ~/devstack ./unstack.sh Source: https://docs.openstack.org/devstack/latest/ »

docker-compose.yml version: "2" services: nginx: image: nginx container_name: nginx restart: always links: - ghost - jenkins ports: - "80:80" volumes: - /home/debian/nginx:/etc/nginx ghost: image: ghost:1.19 container_name: ghost restart: always expose: - "2368" environment: - »

HotSpot Garbage Collectors Young Generation Serial is a stop-the-world copying collector that uses a single GC thread ParNew is a stop-the-world copying collector that uses multiple GC threads ParallelScavenge is a stop-the-world copying collector that uses multiple GC threads Old Generation Serial Old (Mark Sweep Compact) is a stop-the-world mark-sweep-compact »

Extensions for Angular in Code: angular-cli angular v4 snippet (or v5) Debugger for Chrome TSLint TypeScript Importer »

First need to install Boostrap, jQuery and ng-bootstrap with: npm install bootstrap jquery @ng-bootstrap/ng-bootstrap --save Next add Boostrap and jQuery file paths to angular-cli.json: "styles": [ "styles.css", "../node_modules/bootstrap/dist/css/bootstrap.min.css" ], "scripts": [ "../node_modules/jquery/ »

Create EnvironmentType enum: public enum EnvironmentType { VAPP, PHYSICAL, CLOUD } then create qualifier: @Qualifier @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.TYPE}) public @interface EnvironmentQualifier { EnvironmentType value(); } ... next create abstract class or interface Environment: public interface Environment { Machine getMachine(String name); } then create EnvironmentLiteral to be able to select environment with »

Create project with npm: mkdir awsomewebproject && cd awsomewebproject npm init -y Install needed dev dependencies: npm install --save-dev webpack webpack-dev-server webpack-merge css-loader style-loader file-loader url-loader babel-core babel-loader babel-preset-es2015 babel-preset-react babel-plugin-transform-class-properties Install all needed dependecies: npm install --save jquery react react-dom bootstrap react-bootstrap Add those lines to scripts section »

pio run -t upload -e sonoff-PL »

sudo apt-get update --fix-missing sudo apt-get update sudo apt-get kodi Note: GPU RAM has to be extended to 128 (https://rpi.vypni.net/omxcore-failed-to-init-on-raspberry-pi-raspbian/) wget -q -O - https://apt.mopidy.com/mopidy.gpg | sudo apt-key add - sudo wget -q -O /etc/apt/sources.list.d/mopidy.list https: »

1. Intalling Node-RED on RPi3: bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered) Enable service: sudo systemctl enable nodered.service 2. Installing Mosquitto: sudo apt-get install mosquitto mosquitto-clients 3. Intalling Home-Assistant: sudo apt-get update sudo apt-get upgrade -y sudo apt-get install python3 python3-venv python3-pip sudo »

https://www.bignerdranch.com/blog/developing-alexa-skills-locally-with-nodejs-setting-up-your-local-environment/ https://www.bignerdranch.com/blog/developing-alexa-skills-locally-with-nodejs-implementing-an-intent-with-alexa-app-and-alexa-app-server/ »

Create simple app using maven mvn archetype:generate -DgroupId=org.catcher -DartifactId=SampleApp -DarchetypeArtifactId=maven-archetype-webapp Add parent spring-boot-starter to main pom.xml <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.8.RELEASE</version& »

ESP-01 (ESP8266) NodeMCU »

http://www.theserverside.com/tutorial/Classloaders-Demystified-Understanding-How-Java-Classes-Get-Loaded-in-Web-Applications »

To switch to Java 8 run: sudo update-java-alternatives --set /usr/lib/jvm/java-1.8.0-openjdk-amd64 To switch to Java 9 run: sudo update-java-alternatives --set /usr/lib/jvm/java-1.9.0-openjdk-amd64 »

// core.js define([], function() { var Private = { objExtend: function(obj) { var args = Array.prototype.slice.call(arguments, 1); args.forEach(function (source) { for (var prop in source) { if (prop) { obj[prop] = source[prop]; } } }); return obj; }, extend: function(protoProps, staticProps) { /*jshint validthis:true */ var parent = this; var child; if (protoProps && »

Source: http://torsten-traenkner.de/wissen/smarthome/heizung.php sudo apt-get install pi-bluetooth // not needed, check it sudo apt-get install bluez bluetooth sudo -i hciconfig hci0 up gatttool -I -b XX:XX:XX:XX:XX:XX connect char-write-req 0x0047 00000000 char-read-hnd 0x003f disconnect exit Another solution Source: https://github.com/im-0/ »

To add GIT alias type: git config --global alias.ger "push origin HEAD:refs/for/master" To list GIT aliases type: git config --get-regexp alias »

https://dzone.com/refcardz/getting-started-with-mqtt »

Action that you want to execute: public async Task<string> ExecuteAsync(string command) { return await Task.Run(() => { using (var client = new SshClient(hostname, port, username, password)) { client.Connect(); return client.CreateCommand(command).Execute(); } }); } And async button handler: private async void buttonExecuteCommandAsync_Click(object sender, EventArgs eventArgs) { VAppSSHManager »

https://coursetro.com/courses/12/Learn-Angular-4-from-Scratch »

Model Mapper - very nice lib: http://modelmapper.org/getting-started/ »

> mkdir ghost > nano ghost/Dockerfile Put into the Dockerfile: FROM ghost:1.8 > docker build ghost/ > docker tag ghost wapacz/ghost > docker login ... > docker tag ghost wapacz/ghost > docker push wapacz/ghost »