Skip to content

Instantly share code, notes, and snippets.

View bcamarneiro's full-sized avatar

Bruno Camarneiro bcamarneiro

View GitHub Profile
//JS (es6)
//
const crazyArray = [[1,2,3], [1,2,3,4,5,[6, [7, [8]]]], [1,1,1,1,1,1,1,1]];
flatten = (arr) => {
if(!Array.isArray(arr)){
throw "Parameter is not an array!";
}
return arr.reduce((acc, el) => {

Keybase proof

I hereby claim:

  • I am bcamarneiro on github.
  • I am bcamarneiro (https://keybase.io/bcamarneiro) on keybase.
  • I have a public key whose fingerprint is 1044 B8BA BBA8 80B9 A2AD 5626 C8D7 D562 27E9 9E51

To claim this, I am signing this object:

@bcamarneiro
bcamarneiro / cloudSettings
Last active March 20, 2019 09:21
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-03-20T09:21:43.218Z","extensionVersion":"v3.2.7"}
@bcamarneiro
bcamarneiro / gist:75935d306bab2b7bc23aa11ece789b13
Last active June 25, 2018 14:00
Informação Pavilhão da Boa Hora
Nome: Boa Hora - Pavilhão
Morada: Rua da Boa Hora n.º 26
Superfície: Madeira
Máx. de jogadores: 20
Características: Instalação coberta, Iluminação artificial, Balneário
Descrição: Pavilhão desportivo da Universidade do Porto.
------------------------------------------------------------------------
lsof -n -i4TCP:$PORT | grep LISTEN
lsof -n -iTCP:$PORT | grep LISTEN
lsof -n -i:$PORT | grep LISTEN
@bcamarneiro
bcamarneiro / Outlook VBA Script Set Auto BCC
Created May 6, 2014 14:34
VBA Script To Outlook 2013 that sets Auto BCC
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim Msg As Outlook.MailItem
Dim onsMapi As Outlook.NameSpace
Dim objRecip As Recipient
Dim strMsg As String
Dim res As Integer
Dim strBcc As String
On Error Resume Next
@bcamarneiro
bcamarneiro / Single Value from mysqli PHP.php
Created April 22, 2014 15:14
Return single value from mysqli PHP
$name = $mysqli->query("SELECT name FROM contacts WHERE id = 5")->fetch_object()->name;
@bcamarneiro
bcamarneiro / ajaxcalljQuery.js
Created March 13, 2014 15:12
jQuery AJAX call
$.ajax( {
type:'Get',
url:'http://192.168.2.156:8080/bestblue/LocationService',
success:function(data) {
$('#base').html(data);
}
})