1. Setup configuration: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <archive> <manifest> <mainClass> main.ProductionTools </mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </execution> </executions> </plugin> 2. Execute the command below. mvn clean install 3. Check the created file ended with jar-with-dependencies Verify the folder, target, for the jar ended with the name “jar-with-dependencies”. … Read More “MAVEN: GENERATING AN EXECUTABLE JAR” »
Author: Leonardo Regis
Basic concepts: -key-value store -NoSql -Values with expiration/ good for security Commands (=> indicates the return expected) SET server:name “fido” – store based into a key SETNX – store if not exists values EXPIRE resource:lock 120 – set a value to exists only for some defined time TTL resource:lock 113 – gets the last duration … Read More “NOSQL: REDIS – ANOTATIONS” »
/** * Wait until the test condition is true or a timeout occurs. Useful for waiting * on a server response or for a ui change (fadeIn, etc.) to occur. * * @param testFx javascript condition that evaluates to a boolean, * it can be passed in as a string (e.g.: “1 == 1” or … Read More “PHANTOMJS: ADDING TIMEOUT FOR WAITING RESPONSES” »
run: npm init npm i @types/node tsc –init into tsconfig.json, uncoment the line below: “moduleResolution”: “node” /* Specify module resolution strategy: ‘node’ (Node.js) or ‘classic’ (TypeScript pre-1.6). */ Leonardo Regis
import angular = require(‘angular’); /* @ngInject */ export class SetFocus implements angular.IDirective { private $log: angular.ILogService; publicstaticFactory(): angular.IDirectiveFactory { return () = >newFocus(); } publiclink:angular.IDirectiveLinkFn = (scopeS: angular.IScope, elementS: JQuery, attrsS: angular.IAttributes) => { if (!this.$log) { this.$log=angular.injector([‘ng’]).get(‘$log’); } if (attrsS.focus===’true’) { elementS[0].focus() ; } scopeS.$on(attrsS.focus, (e) => { elementS[0].focus(); }); } }; // … Read More “ANGULARJS: TYPESCRIPT – USING DIRECTIVE FOR FOCUS” »
const aws = require(‘aws-sdk’); const sns = new aws.SNS(); sns.publish( { Message: message, TopicArn: ‘TOPIC_ARN’ }, function(err, data) { if (err) { console.log(err.stack); return; } console.log(‘push sent’); console.log(data); } ); Leonardo Regis
Create the permission in IAM: … { “Effect”: “Allow”, “Action”: [ “s3:putObject” ], “Resource”: “arn:aws:s3:::my_corporate_bucket/*” } … Tips: You can get the resource ARN just by clicking the bucket and clicking into the button “Copy Bucket ARN” take a look into the link: api on amazon the name of the allowed operations are the fuction ones … Read More “AWS: S3: NOJEJS – PUTOBJECT” »
A sample of creating a get request using nodejs on https let https = request(‘https’); const options = { hostname: ‘www.panda.tv’, path: ‘ajax_chatinfo?roomid=89757’, headers: { ‘User-Agent’: ‘Mozilla/5.0’ } }; console.log(‘generated options’ + options); const req = https.get(options, (res) => { let body = ”; console.log(‘Status:’, res.statusCode); console.log(‘Headers:’, JSON.stringify(res.headers)); res.setEncoding(‘utf8’); res.on(‘data’, (chunk) => body += chunk); … Read More “NODEJS: HTTPS – QUICKSAMPLE” »
class Base { private final String USER_AGENT = “Mozilla/5.0”; public void testConnection ( URL url){ try { HttpURLConnection con = (HttpURLConnection) url.openConnection(); // optional default is GET con.setRequestMethod(“GET”); //add request header con.setRequestProperty(“User-Agent”, USER_AGENT); int responseCode = con.getResponseCode(); System.out.println(“\nSending ‘GET’ request to URL : ” + url); System.out.println(“Response Code : ” + responseCode); BufferedReader in = … Read More “JAVA: HTTP – SIMPLE CALL” »
link of aws tutorial Create the enviroment variable into lambda into the console or some script. //TODO create a sample here of scripting that Call it into the code using the variable process.env.variablename. It will be like the below code, for a myvar name. let localvariable = process.env.myvar; Leonardo Regis