Skip to content

Instantly share code, notes, and snippets.

View flpms's full-sized avatar

Filipe M. Silva flpms

View GitHub Profile
function divisao(numero, dividendo) {
return numero/dividendo;
}
function soma(numeros) {
let totalSoma = 0;
let i;
for (i = 0; i < numeros.length; i++) {
totalSoma += numeros[i];
}
return totalSoma;
}
@flpms
flpms / script-index.js
Last active October 7, 2019 17:03
Meu código antigo escrito em 2009
// JavaScript Document
window.onload = function(){
navigatorUsed = navigator.appName;
URL = new Array();
URL[0] = "services.xml";
tags = new Array();
tags[0] = "li";
tags[1] = "p";
let a = new RegExp(/country\,/, 'gi');
console.log(a.source);
a.source === 'country\,' // false
a.source == 'country\,' // false
@flpms
flpms / regex-example.js
Last active November 7, 2017 19:04
Regular expression problems
let regex = /country\,/gi;
console.log(regex.source) // country\, (In nodejs is country\\,)
regex.source == ‘country\,’; //false
regex.source === ‘country\,’; //false
"use strict";
var Person = (function () {
function Person(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
this.firstName = firstName;
this.lastName = lastName;
}
;
Object.defineProperty(Person.prototype, "fullName", {
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Person = function () {
function Person(firstName, lastName) {
_classCallCheck(this, Person);
@flpms
flpms / commands.bat
Created May 16, 2016 14:17
this bat file associate linux commands to commands in windows
doskey alias = doskey $*
doskey cat = type $*
doskey clear = cls
doskey cp = copy $*
doskey cpr = xcopy $*
doskey grep = find $*
doskey history = doskey /history
doskey kill = taskkill /PID $*
doskey ls = dir $*
doskey man = help $*
var fatorDesq;
var rs = this.getField("rs").value;
var rt = this.getField("rt").value;
var st = this.getField("st").value;
var valores = [rs, rt, st];
valores.sort(function(maior, menor) {
if (maior > menor) return -1;
if (maior < menor) return 1;
if (maior === menor) return 0;
mocha --recursive