Skip to content

Instantly share code, notes, and snippets.

View rsandrade's full-sized avatar

Ricardo Andrade rsandrade

  • Salvador, Bahia, Brazil / Porto, Portugal
View GitHub Profile
@rsandrade
rsandrade / install_go_pi.sh
Last active December 26, 2019 07:53 — forked from random-robbie/install_go_pi.sh
Install Go Lang 1.10.3 on Raspberry Pi 3
wget https://dl.google.com/go/go1.10.3.linux-armv6l.tar.gz
sudo tar -C /usr/local -xvf go1.10.3.linux-armv6l.tar.gz
cat >> ~/.bashrc << 'EOF'
export GOPATH=$HOME/go
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
EOF
source ~/.bashrc
@rsandrade
rsandrade / leftjoinlimitado.sql
Created June 4, 2018 01:50
LIMIT e OFFSET em LEFT JOIN
$f3->set('res_institutions', $f3->get('db')->exec(
'SELECT Institutions.id, Institutions.name, Institutions.country, Users_Institutions.id AS iduserinst FROM Institutions ' .
'LEFT JOIN Users_Institutions ON Users_Institutions.iduser = ' . $f3->get('SESSION.id')[0]['id'] . ' ' .
'AND Users_Institutions.idinstitution = ' . $f3->get('PARAMS.id') . ' ' .
'LIMIT ' . $f3->get('GET.qty') . ' ' .
'OFFSET ' . $f3->get('GET.since')
));

Keybase proof

I hereby claim:

  • I am rsandrade on github.
  • I am rsandrade (https://keybase.io/rsandrade) on keybase.
  • I have a public key ASATjqdF4DCkFcBZep9VLSGea3MyoULGmY2kKReJlQzRJwo

To claim this, I am signing this object:

@rsandrade
rsandrade / config.js
Created May 1, 2017 17:14
Pegar todos os value de checkboxes em uma string com os valores em sequencia
$('#configSalvarGrupo').click(function(){
var checkedValues = $('input:checkbox:checked').map(function() {
return this.value;
}).get();
console.log('Valor: '+checkedValues);
});
<?xml version='1.0' encoding='UTF-8'?>
<Document>
<description>Information about archives in greater Washington, DC metro area including surrounding areas of Maryland and Virginia | Created with http://batchgeo.com</description>
<Placemark>
<styleUrl>#0</styleUrl>
<name>Alan Mason Chesney Medical Archives</name> <ExtendedData>
<Data name='City and State'>
<value>Baltimore, MD</value>
</Data>
<Data name='Archives Foundation Date'>