Target This page is intended to point to interesting techs to help on daily tasks. You may suggest using “comment”. BROWSER BrowserOpener: Open links with different browsers according to rules CODING Code.xyz The online code editor for building APIs in a single click. DEMO CODOTA – JAVA AUTOCOMPLETION PLUS AI www.codata.com DATABASE panoply – on-line … Read More “INFO: TIPS” »
NOTE: English is the usual language here on the purpose to increase sharing possibilities once it is an international language, however the information here is just about some specific brazilean stuff – the CEP, our USPC, so it was written in the native language. Certa vez andei precisando criar massa de dados em vários bancos … Read More “CEP: BASE DE DADOS DE CEP EM MYSQL, POSTGRESQL E DICAS ADICIONAIS” »
/** * 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). */
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); } );
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;