Skip to content

Instantly share code, notes, and snippets.

View guisouza's full-sized avatar
:octocat:

Guilherme ( coder ) de Souza guisouza

:octocat:
  • Data²
  • São Paulo
View GitHub Profile
function main() {
funcaoUm()
.then((um) => {
console.log(um);
return funcaoDois()
})
.then((dois) => {
console.log(dois);
return funcaoTres()
let formula = '(1 / (1 * 1))';
formula = '(1)';
class FormulaParser {
constructor() {
this.index = 0;
this.lexemes = {
delimiters: {
tokens: '()',
expect: [ 'identifiers', 'value' ]
@guisouza
guisouza / net.js
Created January 21, 2016 00:01
Net
Net = function(){
return this.constructor.apply(this,arguments)
}
Net.prototype.constructor = function (navigator) {
this.navigator = navigator;
// this.status = this.navigator.onLine;
this.events = [];
this.timer = setInterval(function(){
window.addEventListener('error', function(e) {
var file = e.filename
var line = e.lineno
var collumn = e.colno
var searchUrl = encodeURIComponent(e.error.message)
console.log('Ocorreu um erro no arquivo',file,'na linha',line,':',collumn)
console.log('Para buscar o erro, acesso o link :','http://stackoverflow.com/search?q='+searchUrl )
console.log('Powered By :')
console.log('%c', 'padding:28px 119px;line-height:100px;background:url(http://cdn.sstatic.net/stackoverflow/img/sprites.png?v=6) no-repeat;');
@guisouza
guisouza / conselho.js
Last active August 29, 2015 14:16
conselho
var CheckJS = (function(arguments) {
'use strict';
function meuMetodoPrivado(){
}
var CheckJS = {
init: function(arguments){
app.filter('filtro', function() {
return function( items, campo, valor) {
var filtered = [];
angular.forEach(items, function(item) {
if(item[campo] === valor) {
filtered.push(item);
}
});
if (filtered.length){
return filtered;
{
"indent_size": 2,
"indent_char": " ",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 3,
"jslint_happy": true,
"brace_style": "collapse",
"keep_array_indentation": false,
@guisouza
guisouza / nodejs_m1_.md
Last active August 29, 2015 14:07
Curso NODEJS - MODULO 1

###Curso de NODEJS - IBTA Modulo 1

1- introdução javascript

  • Origem
  • Mercado
  • Tipagem
  • Execução
  • Escopo
@guisouza
guisouza / bind() Polyfill.js
Created July 29, 2014 20:23
bind() Polyfill
if (!Function.prototype.bind) {
Function.prototype.bind = function (oThis) {
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function () {},
fBound = function () {
return fToBind.apply(this instanceof fNOP && oThis
? this
: oThis,
@guisouza
guisouza / Classical Inheritance emulation experiments in Javascript. the second one.md
Last active December 28, 2017 14:00
Classical Inheritance emulation experiments in Javascript. the second one

##Classical Inheritance emulation experiments in Javascript. the Second one

(just because I like it)

I've been experimenting different ways to emulate classical inheritance in javascript and I will daily publish insights about some experiments that I've been doing in the last months till I reach a stable and usable solution for this inexistent problem.

The Second one:

The "Class" 'Class';

function Class(){}