Skip to content

Instantly share code, notes, and snippets.

View dpordomingo's full-sized avatar
🏠
Working from home

David Pordomingo dpordomingo

🏠
Working from home
View GitHub Profile
@dpordomingo
dpordomingo / reproduce_transport_chain.go
Last active October 16, 2019 07:51
Reproduce how request and response can be ruined if readed along the chain.
package main
import (
"bytes"
"context"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
@dpordomingo
dpordomingo / README.md
Last active March 12, 2019 14:13
Find slow repos

ussage:

./analyze.sh SIVA_BUCKETS_PATH TIMEOUT_BUCKET TIMEOUT_SIVA

where:

  • SIVA_BUCKETS_PATH is where siva buckets are stored, example: ~/repos/pga/siva/latest
  • TIMEOUT_BUCKET is 10 times the limit of seconds beyond a bucket will be marked as "needed to be reviewed", example: id set to 60, it will wait 6sec for each bucket to be initialized.
  • TIMEOUT_SIVA is 10 times the limit of seconds beyond a siva file will be marked as "slow",
@dpordomingo
dpordomingo / count_commits.go
Created March 11, 2019 14:00
Count commits from `HEAD` with `go-git`
package main
import (
"fmt"
"os"
"strconv"
"gopkg.in/src-d/go-git.v4"
. "gopkg.in/src-d/go-git.v4/_examples"
"gopkg.in/src-d/go-git.v4/plumbing/object"
@dpordomingo
dpordomingo / gist:cb0a87e6d1c78c10cbbd2c03015cc3ba
Created February 14, 2018 06:40 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@dpordomingo
dpordomingo / general.bashrc.sh
Last active February 6, 2018 15:36
Aliases .bashrc
# Edit the .bashrc
alias bashedit='vi ~/.bashrc; bashreload; cd -'
alias bashreload='source ~/.bashrc'
# Converts a drawing image into a wireframe
alias convertImage='function _F { convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2;}; _F '
# Clean apt cache, remps and remove dangling packages
alias aptClean='sudo apt-get autoclean; sudo apt-get purge; sudo apt-get autoremove; sudo apt-get clean; sudo apt autoclean; sudo apt autoremove; sudo apt clean; sudo apt purge;'
@dpordomingo
dpordomingo / whiteboardCleaner.md
Created January 25, 2018 05:46 — forked from lelandbatey/whiteboardCleaner.md
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@dpordomingo
dpordomingo / report1-succeeding-db.txt
Created December 20, 2017 18:53
Flaky tests: Dataframe containing duplicated files is not properly saved #src-d/gemini/issues/22
blob_hash | repo | file_path
------------------------------------------+------------------------------------+--------------------------------------
9a57dd0fb23e913c2022a931d1c82bc7e3b5915d | github.com/src-d/borges.git | changes_test.go
849d2899f0af066c837aede38aa2ed9e884698b1 | github.com/erizocosmico/borges.git | fixtures_test.go
170a9de78cb5ad7c57574d0f4658b3329436d94f | github.com/src-d/borges.git | storage/database_test.go
75f34bff7c647aeb44395ca42bb0ea048af5b337 | github.com/src-d/borges.git | .travis.yml
cd413eee2aea26b2f0b50f7bae2aaeb71b9c12f5 | github.com/erizocosmico/borges.git | git.go
493d45ba4391e78dbc258934c9ecebabd5ae8d40 | github.com/erizocosmico/borges.git | model_test.go
493d45ba4391e78dbc258934c9ecebabd5ae8d40 | github.com/src-d/borges.git | m
@dpordomingo
dpordomingo / siva-read-write.go
Last active December 18, 2017 09:08
Siva read-write
package main
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"time"

Keybase proof

I hereby claim:

  • I am dpordomingo on github.
  • I am dpordomingo (https://keybase.io/dpordomingo) on keybase.
  • I have a public key whose fingerprint is D38A 70FE C87D 0E70 64C0 6215 AB1A 2E52 9904 6FF6

To claim this, I am signing this object:

package main
import (
"fmt"
"math/rand"
//"strconv"
//"strings"
)
func main() {