Skip to content

Instantly share code, notes, and snippets.

View matheus-souza's full-sized avatar
🚀
In search of knowledge

Matheus Henrique de Souza matheus-souza

🚀
In search of knowledge
View GitHub Profile
@matheus-souza
matheus-souza / ExemploAdapter.java
Created February 13, 2017 00:10
Exemplo de adapter para recyclerview
public class ExemploAdapter extends RecyclerView.Adapter<ExemploAdapter.ExemploViewHolder> {
private final ArrayList<Exemplo> exemploArrayList;
private final Context context;
private ExemploOnClickListener exemploOnClickListener;
public ExemploAdapter(Context context, ArrayList<Exemplo> exemploArrayList, ExemploOnClickListener exemploOnClickListener) {
this.context = context;
this.exemploArrayList = exemploArrayList;
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>reveal.js</title>
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/black.css">
@matheus-souza
matheus-souza / kill-multiple-containers
Created May 9, 2017 04:13
Matando todos os containers em execução
sudo docker kill $(sudo docker ps -q)
@matheus-souza
matheus-souza / docker-compose.yml
Last active April 18, 2018 14:40
Docker composer for Portainer
portainer:
image: portainer/portainer
ports:
- "9000:9000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /srv/docker/portainer:/data
@matheus-souza
matheus-souza / getLogin.sql
Created July 5, 2017 20:02
Select user login
--PEGA LOGIN DE ALUNO
SELECT(
SELECT w.miolousername
FROM acdcontract z
INNER JOIN ONLY basphysicalpersonstudent w
USING (personid)
WHERE z.contractid = x.contractid)
AS login
FROM acdenroll x
WHERE x.groupid = (
@matheus-souza
matheus-souza / schemaspy.sh
Created July 28, 2017 18:59
Export schemaspy
sudo docker run -v $PWD/output:/output schemaspy/schemaspy:snapshot -t pgsql -db sagu -host serverip -u postgres -p postgres [-hq]
@matheus-souza
matheus-souza / restore_dump_gz.sh
Created August 29, 2017 16:17
Restoring database .gz file
gunzip -c dbdump.sql.gz | psql -Upostgres database
<?xml version="1.0" encoding="UTF-8"?><!--
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
Oracle and Java are registered trademarks of Oracle and/or its affiliates.
Other names may be trademarks of their respective owners.
The contents of this file are subject to the terms of either the GNU General Public
License Version 2 only ("GPL") or the Common Development and Distribution
@matheus-souza
matheus-souza / aviso.sh
Created October 7, 2017 17:03
Script criar um alias que gera uma notivicação ao terminar um processo
#!/bin/bash
# Script criar um alias que gera uma notivicação ao terminar um processo
# desenvolvido por Matheus Henrique de Souza
# Mail: mh.matheussouza@gmail.com
# Data de criação: 07-10-2017
echo "alias aviso='notify-send --icon=utilities-terminal \"Aviso\" \"O processo que estava monitorando chegou ao fim\"'" >> ~/.bashrc