Skip to content

Instantly share code, notes, and snippets.

View edgardleal's full-sized avatar
💻
working from home

Edgard Rosberg Duarte Leal edgardleal

💻
working from home
View GitHub Profile
[ 0.001s] [diagnostic]
********************************************************
[TEST 1/9: webchannel.googleapis.com with default options] STARTING at 2023-05-11T18:18:04.465Z]
********************************************************
[ 0.003s] [diagnostic] >>> [TEST 1/9: webchannel.googleapis.com with default options] createWebChannel("https://webchannel.googleapis.com/staging/channel/generator", {"backgroundChannelTest":true,"httpSessionIdParam":"gsessionid","initMessageHeaders":{},"sendRawJson":true,"supportsCrossDomainXhr":true,"internalChannelParams":{"forwardChannelRequestTimeoutMs":600000},"httpHeadersOverwriteParam":"$httpHeaders","disableRedact":true})
[ 0.004s] [diagnostic] >>> [TEST 1/9: webchannel.googleapis.com with default options] open()
[ 0.005s] [goog.labs.net.webChannel.WebChannelDebug] connect()
[ 0.005s] [goog.labs.net.webChannel.WebChannelDebug] Origin Trials enabled.
[ 0.007s] [goog.labs.net.webChannel.WebChannelDebug] connectChannel_()
[ 0.009s] [goog.labs.net.webChannel.WebChann
[ 0.001s] [diagnostic]
********************************************************
[TEST 1/9: webchannel.googleapis.com with default options] STARTING at 2023-05-10T23:48:09.831Z]
********************************************************
[ 0.016s] [diagnostic] >>> [TEST 1/9: webchannel.googleapis.com with default options] createWebChannel("https://webchannel.googleapis.com/staging/channel/generator", {"backgroundChannelTest":true,"httpSessionIdParam":"gsessionid","initMessageHeaders":{},"sendRawJson":true,"supportsCrossDomainXhr":true,"internalChannelParams":{"forwardChannelRequestTimeoutMs":600000},"httpHeadersOverwriteParam":"$httpHeaders","disableRedact":true})
[ 0.018s] [diagnostic] >>> [TEST 1/9: webchannel.googleapis.com with default options] open()
[ 0.019s] [goog.labs.net.webChannel.WebChannelDebug] connect()
[ 0.019s] [goog.labs.net.webChannel.WebChannelDebug] Origin Trials enabled.
[ 0.020s] [goog.labs.net.webChannel.WebChannelDebug] connectChannel_()
[ 0.021s] [goog.labs.net.webChannel.WebChann
@edgardleal
edgardleal / gravatar.js
Created June 24, 2022 18:16
Download gravatar user images from a git repository folder to be used with gource
const fs = require('fs');
const path = require('path');
const shelljs = require('shelljs');
const crypto = require('crypto');
const size = 90;
const output_dir = '.git/avatar';
shelljs.mkdir('-p', output_dir);
@edgardleal
edgardleal / Main.java
Created April 30, 2018 00:55
Three Java Threads running in parallel and synchronized
import java.util.LinkedList;
import java.util.List;
/**
* <p>
* This class will start a Thread to generate a certain number os random numbers and
* other Thread to accumulate odd numbers and other Thread to accumulate even numbers.
*
* Each Thread will wait for previous Thread to make its action.
*
@edgardleal
edgardleal / tree.sh
Last active June 12, 2017 12:36
A simple replacement for command `tree` for use when you can't install tree
#! /bin/sh
#
# tree.sh
#
#
declare max_level=10
declare dir="$1"
declare -r last="└-"

Keybase proof

I hereby claim:

  • I am edgardleal on github.
  • I am edgardleal (https://keybase.io/edgardleal) on keybase.
  • I have a public key whose fingerprint is 0A27 8D13 895D D55F F5C9 38CA BF05 C769 F4DE FFB4

To claim this, I am signing this object:

@edgardleal
edgardleal / backup_history.sh
Last active May 31, 2017 19:17
Backup bash or zshell history shell to not lost any command
#!/bin/bash -
#title :backup_history.sh
#description :This script will make a backup of bash history.
#author :Edgard Leal <edgardleal@gmail.com>
#date :20160221
#version :0.3
#usage :bash backup_history.sh
#notes :
#bash_version :4.1.5(1)-release
#==============================================================================
@edgardleal
edgardleal / Auto create and load vim session
Created April 5, 2017 16:12
Auto create a vim session ( mksession ) on current directory when you exit vim , and auto load ( if exists ) the last vim session when you run vim.
autocmd VimLeave * mksession! session.vim
if !empty(glob("session.vim"))
source session.vim
endif
@edgardleal
edgardleal / Awesome_Git_commands.md
Last active March 17, 2017 16:44
Awesome git commands
  • Users
    • Commits by User: git shortlog -sn
  • Files
    • Files changed in a commit: git diff-tree --no-commit-id --name-only -r
  • Stats
    • Stats numbers by date: git diff --numstat "@{1 day ago}"
    • Modifications by date: git diff --stat "@{1 day ago}"
    • Log by date: git log --since 2015/12/25 --until 2016/01/26
    • Changes in a range of lines: git log -L 114,118:src/WorldController.java
  • Who modified the range of line: git blame -L 315,350 file.txt
sed -i '{
${s/\(^[^\/].*\)/\1\n\/*vim: set ts ex=2 :*\//g
}}' **/*.js