Skip to content

Instantly share code, notes, and snippets.

View caisback's full-sized avatar

caisback

View GitHub Profile
@caisback
caisback / Java Naming Convention Collection 2021.md
Last active April 24, 2021 00:27
Java Naming Conventions Collection 2021

They must be followed while developing software in java for good maintenance and readability of code. Java uses CamelCase as a practice for writing names of methods, variables, classes, packages and constants.

camelCase

camelCase is a naming convention in which the first letter of each word in a compound word is capitalized, except for the first word.

  newStudent;
  getNewStudent()
  myVariableNameHere;
@caisback
caisback / Apache Camel Blueprint DSL Adding reference to property file (.cfg or .properties) as blueprint property placeholders.md
Last active May 2, 2021 06:08
Apache Camel Blueprint DSL - Adding reference to property file (.cfg/.properties) as blueprint property placeholders
@caisback
caisback / Apache Camel - pom.xml - Adding Reslet dependecy and repository.md
Created May 4, 2021 22:51
Apache Camel - pom.xml : Adding Reslet dependecy and repository

Open your pom.xml file

Replace;

  </dependencies>
  <repositories>

With;

	<!-- https://mvnrepository.com/artifact/org.restlet.jee/org.restlet -->
	
@caisback
caisback / Apache Camel - Data Mapping Ideas Scattered Over the Net.md
Created May 6, 2021 00:20
Apache Camel - Data Mapping Ideas Scattered Over the Net
  • Small example to show a solution for your use-case with mixins:
class Data {
    int totalUsers;
    int totalBooks;
}

class DataMixin {
 @JsonProperty("Total Users")
@caisback
caisback / Apache Camel Blueprint - How to use a variable or alternative.md
Created May 11, 2021 06:08
Apache Camel Blueprint - How to use a variable or alternative

blueprint.xml

<setHeader headerName="token">
    <constant>someValue</constant>
</setHeader>

<setHeader headerName="userName">
    <simple>${properties:userName}</simple>  //from config
</setHeader>
@caisback
caisback / Apache Camel Blueprint - How to set and get http response.md
Created May 11, 2021 09:43
Apache Camel Blueprint - How to set and get http response

Exchange.HTTP_RESPONSE_CODE GET

${header.CamelHttpResponseCode}

SET

.setHeader(Exchange.HTTP_RESPONSE_CODE, constant(403))
.setHeader(Exchange.CONTENT_TYPE, constant("text/plain"))
.setBody(constant("Forbidden"))
@caisback
caisback / TS error Failed at the expressjs@1.0.0 start script -
Last active May 16, 2021 22:38
misleading error message with '--transpileOnly'TS error Failed at the expressjs@1.0.0 start script
* from https://github.com/wclr/ts-node-dev/issues/223
Resolution:
--transpileOnly to --transpile-only
@caisback
caisback / Adding Existing Codes to Newly created github repo.md
Created May 17, 2021 21:45
How to Add Existing Codes to Newly created github repo
@caisback
caisback / Ubuntu 20.04 - Upgrading to node 16.md
Created May 17, 2021 23:06
Ubuntu 20.04 - Upgrading to node 16.0
@caisback
caisback / Nuxt Js Dockerized.md
Last active May 19, 2021 20:34
Nuxt Js Dockerized
  • Dockerfile | 366MB
FROM node:11.13.0-alpine

# create destination directory
RUN mkdir -p /usr/src/app/nuxtjs
WORKDIR /usr/src/app/nuxtjs

# update and install dependency
RUN apk update && apk upgrade